[ENet-discuss] Ping servers
Lee Salzman
lsalzman1 at cox.net
Thu Nov 29 05:46:59 PST 2007
Using a full ENet connection for that is overkill. Use the enet
socket functions to set up a raw UDP socket, and simply have
each client send a packet with its local time to the server. The
server just sends a UDP packet back with that time to wherever
it came from.
Lee
Martin Sherburn wrote:
> I'm using enet for my multiplayer game. I have coded up a master server
> which clients connect to to get a list of game servers all using enet. I
> was just wondering what the best way to ping the servers is. Clearly the
> clients need to do this individually, rather than getting that
> information from the master server.
>
> As far as I can see there are two options:
>
> - Client connects to the server using enet protocol, sends a ping
> request (or several) then disconnects on receipt.
> - Use a technique similar to the command line ping tool.
>
> I would prefer to use the second approach because it means I don't need
> to code anything up on the server side. But as far as I can tell enet
> doesn't provide any way to make this possible. From what I've read the
> ping tool uses ICMP instead of UDP, so why should it? But as this is a
> common thing needed for most multiplayer games. I was hoping to find
> somebody who has done this already.
>
> I wasn't able to find any c/c++ library with a simple interface to do
> this for me. Any suggestions?
>
> Thanks,
>
> Martin Sherburn.
>
More information about the ENet-discuss
mailing list