Sockets

Pehr Anderson pehr at eink.com
Fri Sep 1 17:17:16 CEST 2000


I'm not sure about your situation with .close and .shutdown
I don't know much about how to see what NT is doing with its IP stack.

Here is the most recent timeout socket announcement from Timo:

The timeoutsocket.py module has received a minor update, 
bringing it up to version 1.5.  The two changes are as follows:
  
   1- A Windows fix.  Apparently, error code 10035 is not an error at       
	all as a result of connect().
   2- The old socket module is now hidden in _timeoutsocket instead of
       _socket, to prevent the possibility of any naming conflicts. 
  
 Where can I get it?
   http://www.timo-tasi.org/python/timeoutsocket.py
  
 What is timeoutsocket?
   It is a nifty way to add a timeout to TCP sockets.
   See the original announcement:
  
 http://x56.deja.com/[ST_rn=ps]/getdoc.xp?AN=652595989&CONTEXT=967009242.
 1055981596&hitnum=0
  



On Fri, Sep 01, 2000 at 04:21:10PM +0530, Sandipan Gangopadhyay wrote:
> How do I implement timeoutsocket ?
> Where can I read about it ?
> 
> I have a situation where socket.shutdown() only marginally improves socket
> bind release as compared to socket.close()
> 
> Thanks
> 
> Sandipan
> 
> ----- Original Message -----
> From: "pehr anderson" <pehr at pehr.net>
> Newsgroups: comp.lang.python
> To: <python-list at python.org>
> Sent: Friday, September 01, 2000 10:47 AM
> Subject: Re: Sockets
> 
> 
> > For this sort of spider app you might want to try timeoutsocket
> > which is an overlay on conventional python sockets that
> > causes them to timeout after a specified number of seconds.
> >
> > Being tied to an IP stack, your computer has a maximum of 65535
> > active sockets. With the normal 2 hour timeout for IP sockets,
> > your spider probably doesn't take long to fill up this entire space!
> > Check this by running netstat on linux. I don't know if windows
> > has a diagnostic tool for this...
> >
> > -pehr
> >
> >
> > David Arnold wrote:
> > >
> > > -->"Aahz" == Aahz Maruch <aahz at netcom.com> writes:
> > > In article <8odh9e$qqf$1 at nnrp1.deja.com>, <karlsass at my-deja.com>
> > > wrote:
> > >
> > >   >>  I have a set of spiders running on my system, The spiders
> > >   >> communicate with a urlserver & a processing server via internal
> > >   >> sockets. The spiders are the only ones using Inet sockets. Yet
> > >   >> after a while of say 1 or 2 spiders, a urlserver and process
> > >   >> server running , say for 3 hours, then all of a sudden the system
> > >   >> disallows any connections to the outside, eg inet sockets as well
> > >   >> as Netscape cannot connect to other web located resources.
> > >
> > >   Aahz> Yeah, sounds like you're not properly closing down the sockets
> > >   Aahz> after you use them.
> > >
> > > i had a bug yesterday, on WinNT (it was on someone else's system so
> > > i'm not sure about this), where using socket.close() does not close
> > > the underlying socket, byt socket.shutdown() does.
> > >
> > > might be worth a go?
> > >
> > > d
> > --
> > http://www.python.org/mailman/listinfo/python-list
> >
> 




More information about the Python-list mailing list