Checking if port is in use.

elbertlev at hotmail.com elbertlev at hotmail.com
Sat Mar 19 10:45:53 EST 2005


How about this?

try:
    s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR,1)
    s.bind((HOST, PORT))
except socket.error, e:
    if e....
        print "address already in use"




More information about the Python-list mailing list