Re: Minimizing Connection reset by peer exceptions

2005-10-20 Thread Ben Sizer

Steve Holden wrote:

> Do note, though, that if you aren't using some means (threading,
> forking, etc) of handling the connections asynchronously then your
> server will normally only queue a very limited number of connections
> (usually 5 at most).

The example given by the original poster seemed to be a client (using
connect_ex) rather than a server, so I think this would only be an
issue if the code was connecting to the same host repeatedly in quick
succession.

-- 
Ben Sizer

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Minimizing Connection reset by peer exceptions

2005-10-20 Thread Steve Holden
Ben Sizer wrote:
> [EMAIL PROTECTED] wrote:
> 
> 
>>Occasionally (perhaps 5% of the time) the following exception gets
>>raised:
>>
>>(10054, 'Connection reset by peer')
> 
> 
> Generally this just means the connection has closed through some
> unusual means, perhaps by being turned off, or a network cable being
> unplugged, or a timeout along the way, etc. 5% is a high figure, but
> perhaps you connect to hosts that are unreliable for some reason.
> 
> You don't have control over this really; just make sure you handle the
> exception. Such is life, when dealing with networking.
> 
Do note, though, that if you aren't using some means (threading, 
forking, etc) of handling the connections asynchronously then your 
server will normally only queue a very limited number of connections 
(usually 5 at most).

So if your service takes a while to run then it's possible that 
connection requests will be rejected when the queue is full, which might 
*possibly* result in the error you are seeing.

Feel free to ignore this if you only have one client at a time.

regards
  Steve
-- 
Steve Holden   +44 150 684 7255  +1 800 494 3119
Holden Web LLC www.holdenweb.com
PyCon TX 2006  www.python.org/pycon/

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Minimizing Connection reset by peer exceptions

2005-10-20 Thread Ben Sizer

[EMAIL PROTECTED] wrote:

> Occasionally (perhaps 5% of the time) the following exception gets
> raised:
>
> (10054, 'Connection reset by peer')

Generally this just means the connection has closed through some
unusual means, perhaps by being turned off, or a network cable being
unplugged, or a timeout along the way, etc. 5% is a high figure, but
perhaps you connect to hosts that are unreliable for some reason.

You don't have control over this really; just make sure you handle the
exception. Such is life, when dealing with networking.

-- 
Ben Sizer

-- 
http://mail.python.org/mailman/listinfo/python-list