no buffer space available error
sebastien
s.thuriez at laposte.net
Fri May 17 13:11:19 EDT 2002
Thanks Peter,
That's probably true since when the program stop there is a long list
of socket.
Is there a way in python to have the same information as in netstat. I
could call netstat but it is a little bit slow.
The shutdown method : s.shutdown(2) for example
does not work with my socket. Is it ok to use it with non blocking
socket ?
Regards.
Sebastien.
Peter Hansen <peter at engcorp.com> wrote in message news:<3CE2F40E.DFB2C61B at engcorp.com>...
> sebastien wrote:
> >
> > I have simplified the program so that you can count the number of
> > socket open at a time.
> >
> > 1) I have checked that all the sockets open are closed (see the code)
>
> There's no guarantee that close() for a socket will actually
> release all the resources. If you open a bunch of client sockets
> and then close them, I believe you'll see with 'netstat' that
> they are in some kind of CLOSE_WAIT state, which might persist
> for a while. This may or may not reduce the number of sockets
> that the OS makes available.
>
> Another thing you might investigate is Socket.shutdown() ...
>
> Also, it's recommended usually that you use the 'threading'
> module instead of 'thread'...
>
> -Peter
More information about the Python-list
mailing list