Please help with Client / Server Blues.

Ruud de Rooij * at spam.ruud.org
Wed Aug 2 14:27:56 EDT 2000


Sindh <skodela at my-deja.com> writes:

> I am trying to create a socket connection between two linux boxen.
> 
> server is as below. Then when I try to connect to the socket from other
> machine which is connected via ethernet , [ which is up], it says
> connection
> refused.
> But if I try to run both cli and server on the same machine with
> 127.0.0.1
> if works without any problem.

[...]

> s.bind("localhost",portnum)
> s.listen(8)

Here you are binding your listening socket explicitly to the localhost 
interface.  Use

s.bind("", portnum)

instead (cf. library reference 7.2 "the empty string represents
INADDR_ANY").

	- Ruud de Rooij.
-- 
ruud de rooij | *@spam.ruud.org | http://ruud.org



More information about the Python-list mailing list