2007/12/24, Bjoern Schliessmann <[EMAIL PROTECTED]>: > Hendrik van Rooyen wrote: > > <[EMAIL PROTECTED]> wrote: > > >> What I don't like about FIFO, is that on Unix they are persistent > >> files. So whatever happens to Manager they would stay there... > >> I was just wondering if there's another way of doing the above > >> and if not, I would probably go with FIFO. Thanks! > > > > The persistence bit is true, and can lead to puzzling behaviour > > when you are still debugging, as the recipient can get a mix of > > old and new data after a crash. > > > > It is probably best to delete them and create them for every run, > > either in a BASH script, or in the Python programme that first > > opens the pipe. > > You could also drain the pipe in a script using > "cat <pipe-goes-here>". > > > As for the alternative, on Linux, sockets seem to hang around for > > a while after a run, until the OS deletes them, so that repetitive > > execution can give you a socket in use error.
To solve that "problem" with socket in use error, you should set the SO_REUSEADDR socket option in the server before calling bind. > > In my experience this only happens if you kill the program. If it > terminates normally it should close its socket so it is "freed" > immediately. > Supossing you run the client and server on the same machine, then when the client finishes the connection normally, client final state is TIME_WAIT (and this is not a bad thing actually, like some people seems to think). Why TIME_WAIT state exists: to allow old duplicates segments to expire in the network, and, to implement TCP's full-duplex connection termination reliability. > Grüße, > > > Björn > > -- > BOFH excuse #422: > > Someone else stole your IP address, call the Internet detectives! > > -- > http://mail.python.org/mailman/listinfo/python-list > -- -- Guilherme H. Polo Goncalves -- http://mail.python.org/mailman/listinfo/python-list