Listening socket not seen outside of localhost

Christian von Essen christian at mvonessen.de
Mon Jun 21 11:31:55 EDT 2004


Hi,

As I don't know if my problem is python, platform or non-specific, I try
to post my question here, as you may have made similar experiences.

I try to write a simple chatserver, using the socket module. Everything
works fine, as long as I'm trying to connect to the server from the host,
the server is running. If I try to access the server from another computer
in my local network, the connection is refused.

No firewall is running and other services (like ssh or httpd) can be
connected to.
I'm running Python 2.3.4 on a AMD Athlon using Fedora Core 2.

I initialize the sockets the following way:
	self._addr = socket.gethostname()
        self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        self.socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR,
        True)
	self.socket.bind((self._addr, self._port))
        self.socket.listen(self._backlog)

Then I'm accepting clients in an endless loop.

Do you know, why the server is just seen locally? 
(I did nmap from a remote host in my LAN and netstat also shows the server
listening)

Christian



More information about the Python-list mailing list