[ENet-discuss] Broadcasting to multiple servers

Josh Szepietowski goosey at gmail.com
Tue Feb 20 13:12:14 PST 2007


Hi Ben,

I ran into this same issue. Currently the solution I am using is to drop
down to low level UDP on the servers to broadcast their network information.
Clients listen to this and are able to form a list of the servers on the
network, and initiate connections to them in a non-broadcast manner.

Not sure how to have a more enet-integrated solution to this issue (which
would be nice), but the issue (as far as I can tell) is that my enet-clients
only allow 1 connection, and so all the servers 'jump on that connection'
and whoever jumps quickest gets the slot...

So random thought that might cure: allow multiple connections on the client
might be a way to make this work (although I have not tried this yet..)

Let us know how it goes! :)

On 2/20/07, Ben Moreno <ben at blitwise.com> wrote:
>
> 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
> _______________________________________________
> ENet-discuss mailing list
> ENet-discuss at cubik.org
> http://lists.cubik.org/mailman/listinfo/enet-discuss
>



-- 
Josh Szepietowski
http://www.goosey.info
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.cubik.org/pipermail/enet-discuss/attachments/20070220/d3638bcf/attachment.htm 


More information about the ENet-discuss mailing list