[ENet-discuss] Unreliable disconnects when shutting down

Lee Salzman lsalzman1 at cox.net
Mon Apr 28 23:07:41 PDT 2008


enet_peer_disconnect_now should do exactly what you need. As far as I 
have tested it, it works.

Lee

Daniel McGarry wrote:
>
> Hey guys,
>
> I’m new to the list, so this may have been discussed before. I browsed 
> the archives and didn’t find anything obvious, so here goes:
>
> I’m trying to organize my “shutdown” sequence so that my peers have 
> their ENET_EVENT_TYPE_DISCONNECT event triggered immediately as I feel 
> I shouldn’t have to wait for the timeout. Also, I’d really prefer not 
> having to sit in some sub-loop for 3 seconds or have my shutdown 
> sequence happen asynchronously. I was hoping to find an enet function 
> that would send off my disconnect command right away so that I can 
> safely call enet_host_destroy and enet_deinitialize immediately 
> afterwards. I know that my peer’s may not be **guaranteed** to receive 
> my disconnect command, but that’s not a tremendous concern.
>
> So far, every enet_peer_disconnect call I make does not cause my 
> peer’s DISCONNECT event to be triggered. I had assumed that 
> enet_peer_disconnect_now would be just what I was looking for, but 
> alas, no disconnect events are ever triggered on peers. I can’t 
> imagine that my packet loss is that severe, so I’m assuming its 
> behavior is not what I’m expecting.
>
> Has anyone run into this? How did you handle it?
>
> Thanks
>
> Dan McGarry
>
>   


More information about the ENet-discuss mailing list