[ENet-discuss] enet_peer_disconnect and ENET_EVENT_TYPE_DISCONNECT

Lee Salzman lsalzman at gmail.com
Tue Jun 28 00:10:16 PDT 2011


My hunch is there is an error in your code. You will have to send me a test case/source code if you would like confirmation otherwise.

On 06/28/2011 05:32 PM, Benoit Germain wrote:
> Hello,
>
> I have an ENet 1.3.2 application that can run in two modes: master and
> slave.The slave contains a "client" host that connects to a "server"
> host in the master.
> The master instance runs the "server" host, but also contains a
> "client" host like a regular slave.
> When a slave terminates, it disconnects its only peer with
> enet_peer_disconnect() and waits a little bit for the disconnection to
> be effective.
> When the master terminates, the "server" host loops over all connected
> peers, and calls enet_peer_disconnect() on them. Then it waits for a
> little while for disconnections to be effective before terminating.
>
> It happens that I have noticed something strange:
>
> My the "client" host in the master instance would not receive the
> disconnect event!
>
> I have fixed this by removing the slave's peer disconnect request when
> the application also contains a "server" host.
>
> Anyway, it would seem that if for some reason two connected hosts
> disconnect the peer connecting them together, the one that initiated
> the connection to begin with won't get the disconnect event.
>
>
> Regards,
>



More information about the ENet-discuss mailing list