Q: simple sockets, bind, and socket error 10048

Grant Edwards grante at visi.com
Wed Jul 16 08:20:52 EDT 2003


In article <3f1532e3.3717465 at news.online.de>, Johannes Eble wrote:

> Note that I start a client one by one (in the same client's dos
> box). It seems that the older port numbers can't be used
> anymore even if the client is closing the connection and
> terminating.

The port can't be used because it's still in use.  When you
close a TCP connection, it doesn't go away immediately.  It
goes into a "wait" state for several minutes just in case there
are packets belonging to that connection wandering around the
internet.  If you want to skip that waiting state (a decision
which a small risk associated), set the SO_REUSEADDR option on
the socket.

> I do not understand why the port is still in use.

Stevens chapter 18:

http://www.amazon.com/exec/obidos/ASIN/0201633469/qid=1058357912/sr=2-1/ref=sr_2_1/103-3800181-0657431

-- 
Grant Edwards                   grante             Yow!  I like the way ONLY
                                  at               their mouths move... They
                               visi.com            look like DYING OYSTERS




More information about the Python-list mailing list