[ENet-discuss] Broadcasting to multiple servers

Ben Moreno ben at blitwise.com
Tue Feb 20 08:37:12 PST 2007


Hello all,

I'm running into a problem when trying to use ENet to find servers on  
a local network.  I need to be able to be able to broadcast a packet  
such that any servers that are listening can either respond in kind  
or initiate a connection.  As far as I can see, there is no way of  
being sure that you've connected to more than whichever server  
happens to reply first.

The servers I'm using are simple ENet servers, essentially from the  
tutorial.   The client (after initializing everything as usual),  
creates a peer with the address set to ENET_HOST_BROADCAST, then  
loops enet_host_service until it receives a connection event.  After  
that, a second peer is created, which also broadcasts.  This peer  
will usually end up connecting to the same server.

Switching the order of calls around doesn't seem to help.  For  
instance, waiting to run enet_host_service() until after both peers  
have been created gives the same behavior (usually).

Am I missing something, or is connecting via ENET_HOST_BROADCAST  
limited to which server happens to respond first?  Is there any way  
of reliably knowing how many servers responded and who they are?

Thanks,
Ben


More information about the ENet-discuss mailing list