[New-bugs-announce] [issue25471] socket.recv() blocks while it's gettimeout() returns 0.0

Alexey Gorshkov report at bugs.python.org
Sat Oct 24 19:03:29 EDT 2015


New submission from Alexey Gorshkov:

socket created with listening socket set to setblocking(False). gettimeout() of accept()-returned socket returns 0.0 , but recv() method blocks while client is connected and not sending any data. If client disconnects, socket returned by accept() starting return 0-length bytes string without blocking.

glibc doc on recv():
---
If nonblocking mode is set for SOCKET, and no data are available to be read, 'recv' fails immediately rather than waiting.
---

testing server and client code attached.

tested with Python 3.5.0 and Python 2.7.10

----------
files: s1.py
messages: 253418
nosy: animus
priority: normal
severity: normal
status: open
title: socket.recv() blocks while it's gettimeout() returns 0.0
versions: Python 2.7, Python 3.5
Added file: http://bugs.python.org/file40855/s1.py

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue25471>
_______________________________________


More information about the New-bugs-announce mailing list