If you have problems with reusing the same port, you should try this socket option
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
just after creating the socket with socket.socket().
Gribouillis
Posting Maven
2,786 posts since Jul 2008
Reputation Points: 1,044
Solved Threads: 691
snippsat
Practically a Posting Shark
808 posts since Aug 2008
Reputation Points: 353
Solved Threads: 294