socket freezes

jordan.taylor2 at jordan.taylor2 at
Sat Mar 4 05:43:20 CET 2006

Might want to check out the SO_REUSEADDR bit in sockets.  I believe it
helps with a problem of a program not notifying the OS that it's done
with the port.
Piece of a script (duh):

host = ""
port = 51423 #random for this example

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
s.bind((host, port))

Good Luck :D

More information about the Python-list mailing list