homepage

This issue tracker has been migrated to GitHub , and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author josiahcarlson
Recipients
Date 2007年01月07日.05:49:50
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
It would seem to me that a connection where sending raises ECONNRESET, ENOTCONN, or ESHUTDOWN, should be closed, as is the case in recv.
However, generally send is usually called before recv, so if we close the connection in send, then recv won't get called. In basically all cases, we want recv() to be called so that we get data from the buffers if possible. Usually if there is data in the buffers, an exception won't be raised, so we wouldn't close the connection until the next pass.
If we make a change at all, I would change send() to:
 def send(self, data):
 try:
 result = self.socket.send(data)
 return result
 except socket.error, why:
 if why[0] == EWOULDBLOCK:
 return 0
 elif why[0] in [ECONNRESET, ENOTCONN, ESHUTDOWN]:
 return 0
 else:
 raise
I have not yet tested the behavior in Python 2.5 yet, as the test cases for Python 2.5 asyncore are basically nonexistent. If we added portions of the test cases provided in patch #909005, we could more easily test these kinds of things.
History
Date User Action Args
2007年08月23日 14:27:23adminlinkissue1063924 messages
2007年08月23日 14:27:23admincreate

AltStyle によって変換されたページ (->オリジナル) /