Fix issue #183 (CPU 100% usage) #277

Merged
ghost merged 1 commits from cpu100percentfix into master 2013-07-01 19:05:39 +02:00

1 Commits

Author SHA1 Message Date
Pedro Gimeno
95a1afb84b Fix issue #183 (CPU 100% usage)
As per http://docs.python.org/2/howto/sockets.html#using-a-socket it's
possible that a socket recv() call returns 0 bytes if the remote closes
the connection. In that case, recv() does not obey settimeout(): it
just doesn't block and returns zero bytes immediately, which in this
case results in an infinite loop if the transmission was incomplete.
2013-07-01 07:36:22 +02:00