The _seen_data flag and its use causes problems in TCPSocket.receive(). By always returning True, even if there is no pending data, a socket can block indefinitely. I know that there's the setblocking(0) call, but it is still bad coding practice to override what select() is returning.
The problem arose when we used eventlet to spawn numerous clients in the same process, in order to load test our servers. A full stanza was received, but the use of the _seen_data flag caused the read loop to continue processing.
If there is a need for _seen_data, it sorely needs documentation, as it is not consistent with any other socket programming example and is very confusing.
I recommend removing it entirely and also removing the setblocking() call. Then give the user tools to call setsockopt and similar calls directly on the connection socket so that they can set it up exactly as they see fit. The connection should also allow a socket object to be passed in so that a user can configure it however they like, including 3rd party socket implementations.
-Aaron Westendorf (aaron@agoragames.com)