[ENet-discuss] how to scan the LAN which server has been started with special port by broadcast message
Lee Salzman
lsalzman at gmail.com
Thu Apr 11 01:44:52 PDT 2013
If you use the enet connect mechanism, you are only going to get a
connection with the first remote host that responds.
The only way to get an actual broadcast functionality is to use raw UDP
sockets. Create a raw UDP socket, broadcast UDP packet over this, have
remote hosts respond in kind with UDP packets, and collect these addresses
so that you may open normal ENet connections to them.
There are tricks you can do to reuse the actual ENet socket for this, but I
would get the basic idea implemented first before worrying about trying to
do that...
On Thu, Apr 11, 2013 at 6:57 AM, zxz3121 at gmail.com <zxz3121 at gmail.com>wrote:
> **
>
> I have used ENet couple days , there are some questions. I have started
> two server by binding the port 59671 , then I created a client
> like this
> ENetAddress caddress;
> caddress.host=ENET_HOST_BROADCAST;
> caddress.port = 59672;
> when I use enet_host_connect it just connected one server,I do not know
> why.
> please help me,I want to know how many servers have been started with port
> 59671 by broadcast message in LAN.
> it will be very grateful,if you can reply and give me an small Tutorial.
> ------------------------------
> zxz3121 at gmail.com
>
> _______________________________________________
> ENet-discuss mailing list
> ENet-discuss at cubik.org
> http://lists.cubik.org/mailman/listinfo/enet-discuss
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cubik.org/pipermail/enet-discuss/attachments/20130411/2dbc6cb9/attachment.html>
More information about the ENet-discuss
mailing list