Re: [Tutor] seeking help to a problem w/ sockets

2008-04-27 Thread Alan Gauld
James Duffy [EMAIL PROTECTED] wrote works. However, if the program that is using this function is closed while listening, it appears that it does not un-bind because when the program is reopened and a listen attepted to start I get a port already in use error. Only a reboot fixes this

Re: [Tutor] seeking help to a problem w/ sockets

2008-04-27 Thread Kent Johnson
James Duffy wrote: I have a problem w/ a file transfer receiver. They way it works is it binds a port for incoming transfer , when the file transfer is complete. It closes the connection and the socket, then loops back and restarts the bind and listen. I have it set so that the socket is

Re: [Tutor] seeking help to a problem w/ sockets

2008-04-27 Thread Martin Walsh
James Duffy wrote: I have a problem w/ a file transfer receiver. They way it works is it binds a port for incoming transfer , when the file transfer is complete. It closes the connection and the socket, then loops back and restarts the bind and listen. I have it set so that the socket is

Re: [Tutor] seeking help to a problem w/ sockets

2008-04-27 Thread tiger12506
How is the window being closed? By someone forcing it to close? Or terminating the process? If someone is just closing the window you can setup an atexit handler that will close the socket before it finishes. However, if the process is being terminated, then you will have to use one of the

Re: [Tutor] seeking help to a problem w/ sockets

2008-04-27 Thread Mark Tolonen
James Duffy [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] [snip] def close( this ): #close all connections and sockets this.conn.close() this.sock.close() def process( this ): #this is the loop of the thread, it listens, receives, closes then repeats

Re: [Tutor] seeking help to a problem w/ sockets

2008-04-27 Thread Jeff Younker
It sounds like a process is still listening on the port. If you're on a Unix system then you can use lsof (aka list open files) to locate the process holding on the socket. Killing the process should free the socket. Also, you don't have to close the socket after every connection completes.