On 11/25/2013 12:35 PM, Malte Forkel wrote:
> I have a Python application that communicates with a server via telnet.
> Host and port of the server are supplied by the user when the
> application is started.
> 
> How can I determine from within the application whether the server's
> host actually is the local host? (In that case I could implement an
> operation not available in the telnet-based protocol by directly
> accessing the local filesystem.)
> 
> Sounds like there should be an obvious solution. Unfortunately, I
> haven't found it yet :-)

I believe socket.getsockname() can return the IP address of the
connecting client if you're using standard tcp/ip sockets.
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to