On 6/10/07, Simon Pickles sipickles@hotmail.com wrote:
Hello,
In my C++ game server, I used the socket number as the temporary ID of the connected player. Is there anyway to retrieve the socket number of a new player?
Atm, I am just using self.transport.getPeer().host, but this is only the IP address, not socket.
If you only need this identifier for use in the implementation of the server, a much better way to identify players is by their Protocol object. On the other hand, if you do need to pass this identifier over the wire, then I agree with Jean-Paul that a small incremental or random number would be good.