On 2007-08-24, Bryan Olson <[EMAIL PROTECTED]> wrote: > Grant Edwards wrote: > [...] >> import socket,random >> >> HOST = '' # Symbolic name meaning the local host >> PORT = 8765 # Arbitrary non-privileged port >> s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) >> s.connect((HOST, PORT)) > > Actually the empty string passed for the host means INADDR_ANY,
You're correct. I copied that code from the server example on the Python socket module doc page, and forgot to change the host. http://docs.python.org/lib/socket-example.html > which does not really make sense for the client. On my Win-XP > system, the client fails with > > socket.error: (10049, "Can't assign requested address") It's interesting that it works on Linux. > For the loop-back adapter, 'localhost' or '127.0.0.1' should > work. Yup. -- Grant Edwards grante Yow! YOU PICKED KARL at MALDEN'S NOSE!! visi.com -- http://mail.python.org/mailman/listinfo/python-list