Listening socket not seen outside of localhost

Diez B. Roggisch deets.nospaaam at web.de
Mon Jun 21 11:59:46 EDT 2004


Christian von Essen wrote:
> 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)

What does self._addr look like? Its supposed to be '' and not 'localhost',
otherwise the bind will only bind to the lo-interface.

Regards,

Diez



More information about the Python-list mailing list