Re: listening socket

2010-09-08 Thread Grant Edwards
On 2010-09-08, Benjamin Kaplan wrote: > On Wed, Sep 8, 2010 at 12:59 PM, cerr wrote: >> but that is not working, i'm getting this: >> import: unable to open X server `' @ error/import.c/ImportImageCommand/ [...] >> now why would it try to open an x server??? :o > > Because it's not executing it

Re: listening socket

2010-09-08 Thread cerr
On Sep 8, 10:06 am, Benjamin Kaplan wrote: > On Wed, Sep 8, 2010 at 12:59 PM, cerr wrote: > > Hi, > > > I'm trying to create a listening socket connection on port 1514. > > I tried to follow the documentation at: > >http://docs.python.org/release/2.5.2/lib/

Re: listening socket

2010-09-08 Thread Benjamin Kaplan
On Wed, Sep 8, 2010 at 12:59 PM, cerr wrote: > Hi, > > I'm trying to create a listening socket connection on port 1514. > I tried to follow the documentation at: > http://docs.python.org/release/2.5.2/lib/socket-example.html > and came up with following lines: &

listening socket

2010-09-08 Thread cerr
Hi, I'm trying to create a listening socket connection on port 1514. I tried to follow the documentation at: http://docs.python.org/release/2.5.2/lib/socket-example.html and came up with following lines: import socket host = '' # Symbolic name meaning all avail

Re: How to reuse TCP listening socket immediately after it was connected at least once?

2009-05-31 Thread Lawrence D'Oliveiro
In message , Thomas Bellman wrote: > We weren't exactly keen on rebooting the machine, but it was the > fastest way of getting out of that situation that we could figure > out. How *should* we have dealt with it in your opinion? Remember, the timed_wait timeout is there for a reason, and trying

Re: How to reuse TCP listening socket immediately after it was connected at least once?

2009-05-30 Thread Thomas Bellman
Lawrence D'Oliveiro wrote: > In message , Thomas Bellman wrote: >> Speaking as a sysadmin, running applications for production, >> programs not using SO_REUSEADDR should be taken out and shot. >> Not using SO_REUSEADDR means forcing a service interruption of >> half an hour (IIRC) if for some r

Re: How to reuse TCP listening socket immediately after it was connected at least once?

2009-05-28 Thread Lawrence D'Oliveiro
In message , Thomas Bellman wrote: > Speaking as a sysadmin, running applications for production, > programs not using SO_REUSEADDR should be taken out and shot. > Not using SO_REUSEADDR means forcing a service interruption of > half an hour (IIRC) if for some reason the service must be > restart

Re: How to reuse TCP listening socket immediately after it was connected at least once?

2009-05-28 Thread Thomas Bellman
Roy Smith wrote: > In article , > Lawrence D'Oliveiro wrote: >> The right thing to do is try to ensure that all your connections are >> properly closed at shutdown. That may not be enough (if your server crashes >> due to bugs), so the other thing you need to do is retry the socket open, >> say

Re: How to reuse TCP listening socket immediately after it was connected at least once?

2009-05-26 Thread Lawrence D'Oliveiro
In message , Roy Smith wrote: > In article , > Lawrence D'Oliveiro wrote: > >> In message , Roy Smith wrote: >> >> > In article , >> > Lawrence D'Oliveiro wrote: >> > >> >> The right thing to do is try to ensure that all your connections are >> >> properly closed at shutdown. That may not b

Re: How to reuse TCP listening socket immediately after it was connected at least once?

2009-05-25 Thread Roy Smith
In article , Lawrence D'Oliveiro wrote: > In message , Roy Smith wrote: > > > In article , > > Lawrence D'Oliveiro wrote: > > > >> The right thing to do is try to ensure that all your connections are > >> properly closed at shutdown. That may not be enough (if your server > >> crashes due to

Re: How to reuse TCP listening socket immediately after it was connected at least once?

2009-05-25 Thread Дамјан Георгиевски
> I have written a socket server and some arbitrary clients. When I > shutdown the server, and do socket.close(), I cannot immediately start > it again cause it has some open sockets in TIME_WAIT state. It throws > address already in use exception at me. I have searched for that in > google but h

Re: How to reuse TCP listening socket immediately after it was connected at least once?

2009-05-25 Thread Lawrence D'Oliveiro
In message , Igor Katson wrote: > I have written a socket server and some arbitrary clients. When I > shutdown the server, and do socket.close(), I cannot immediately start > it again cause it has some open sockets in TIME_WAIT state. It throws > address already in use exception at me. There's a

Re: How to reuse TCP listening socket immediately after it was connected at least once?

2009-05-24 Thread Lawrence D'Oliveiro
In message , Roy Smith wrote: > In article , > Lawrence D'Oliveiro wrote: > >> The right thing to do is try to ensure that all your connections are >> properly closed at shutdown. That may not be enough (if your server >> crashes due to bugs), so the other thing you need to do is retry the >> s

Re: How to reuse TCP listening socket immediately after it was connected at least once?

2009-05-24 Thread Igor Katson
Roy Smith wrote: In article , Lawrence D'Oliveiro wrote: In message , Igor Katson wrote: I have written a socket server and some arbitrary clients. When I shutdown the server, and do socket.close(), I cannot immediately start it again cause it has some open sockets in TIME_WAIT sta

Re: How to reuse TCP listening socket immediately after it was connected at least once?

2009-05-24 Thread Roy Smith
In article , Lawrence D'Oliveiro wrote: > In message , Igor Katson > wrote: > > > I have written a socket server and some arbitrary clients. When I > > shutdown the server, and do socket.close(), I cannot immediately start > > it again cause it has some open sockets in TIME_WAIT state. It thro

Re: How to reuse TCP listening socket immediately after it was connected at least once?

2009-05-24 Thread Igor Katson
google but haven't found a way to solve that. Tried setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) but that does not help. Is there a nice way to overcome this? Solved myself. SO_REUSEADDE should be used on the second listening socket creation (while time_wait already hangs) --

How to reuse TCP listening socket immediately after it was connected at least once?

2009-05-24 Thread Igor Katson
I have written a socket server and some arbitrary clients. When I shutdown the server, and do socket.close(), I cannot immediately start it again cause it has some open sockets in TIME_WAIT state. It throws address already in use exception at me. I have searched for that in google but haven't f