On Sun, 10 Jun 2007 11:26:19 +0100, Simon Pickles email@example.com wrote:
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.
Sockets may not have a file descriptor associated with them on all platforms. It's trivial maintain a counter yourself and assign a small unique integer to each client who connects. Why not do that, instead?