Message144216
| Author |
georg.brandl |
| Recipients |
Florian.Ludwig, docs@python, georg.brandl |
| Date |
2011年09月17日.18:27:48 |
| SpamBayes Score |
4.887129e-09 |
| Marked as misclassified |
No |
| Message-id |
<1316284069.3.0.946588159446.issue12977@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
I think you're mistaking a closed connection with "no data available".
Small demo that this works as intended:
>>> s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
>>> s.connect(('localhost', 1234))
>>> s.recv(10)
^CTraceback (most recent call last):
File "<stdin>", line 1, in <module>
KeyboardInterrupt
>>> s.setblocking(False)
>>> s.recv(10)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
socket.error: [Errno 11] Resource temporarily unavailable
The corresponding server:
>>> x = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
>>> x.bind(('', 1234))
>>> x.listen(1)
>>> x.accept()
(<socket._socketobject object at 0x7f4211e997c0>, ('127.0.0.1', 39146)) |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2011年09月17日 18:27:49 | georg.brandl | set | recipients:
+ georg.brandl, docs@python, Florian.Ludwig |
| 2011年09月17日 18:27:49 | georg.brandl | set | messageid: <1316284069.3.0.946588159446.issue12977@psf.upfronthosting.co.za> |
| 2011年09月17日 18:27:48 | georg.brandl | link | issue12977 messages |
| 2011年09月17日 18:27:48 | georg.brandl | create |
|