Minimizing Connection reset by peer exceptions
- From: mirandacascade@xxxxxxxxx
- Date: 19 Oct 2005 20:04:07 -0700
This may be more of a socket question than a python question; not sure.
Using this code to instantiate/connect/set options
connectionHandle = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
errorStatus = connectionHandle.connect_ex((ipAddress, port))
connectionHandle.setsockopt(socket.SOL_SOCKET, socket.SO_RCVTIMEO,
60000)
Using this code to send:
retSendAll = connectionHandle.sendall(messageToHost)
Followed by this code to recv:
bufferSize = 500000
responseBuffer = connectionHandle.recv(bufferSize)
Occasionally (perhaps 5% of the time) the following exception gets
raised:
(10054, 'Connection reset by peer')
Are there any changes I can make to the code above to eliminate the
10054 errors or to reduce the probability of encountering the 10054
error? Are there any settings that make the 'Connection reset by
peer' condition less likely?
Other posts on this subject seem to suggest that this can only be
handled by:
1) detecting the 10054 error
2) issuing a message explaining the 'connection reset' condition
followed by something along the lines of 'try again later'.
.
- Follow-Ups:
- Re: Minimizing Connection reset by peer exceptions
- From: Ben Sizer
- Re: Minimizing Connection reset by peer exceptions
- Prev by Date: Re: Python vs Ruby
- Next by Date: Re: destroy your self????
- Previous by thread: destroy your self????
- Next by thread: Re: Minimizing Connection reset by peer exceptions
- Index(es):
Relevant Pages
|
|