[Twisted-Python] Socket number

Federico 'Derfel' Stella derfel at alessandria.linux.it
Sun Jun 10 06:20:32 MDT 2007


* Sunday 10 June 2007, alle 11:26, Simon Pickles scrive:

> 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.
self.transport.getHandle().fileno()

.getHandle() returns a normal socket object from which you could get socket
number.

Just for curiosity, are your players anonymous (e.g. not registered)?





More information about the Twisted-Python mailing list