Socket recv(1) seems to block instead of returning end of file.
- From: "Hendrik van Rooyen" <mail@xxxxxxxxxxxxxxx>
- Date: Thu, 23 Aug 2007 11:54:01 +0200
While doing a netstring implementation I noticed that if you
build a record up using socket's recv(1), then when you close
the remote end down, the recv(1) hangs, despite having a short
time out of 0.1 set.
If however, you try to receive more than one char, (I tested with 3,
did not try 2), then when you shut the remote end down you do not
get a time out, but an empty string - the normal end of file, I suppose.
Has anybody else seen this behaviour?
The transmit side seems to give a broken pipe error, which is fine.
I am using stock standard SuSe 10, Python 2.4, out of the box.
- Hendrik
.
- Follow-Ups:
- Re: Socket recv(1) seems to block instead of returning end of file.
- From: Dan Stromberg - Datallegro
- Re: Socket recv(1) seems to block instead of returning end of file.
- From: Grant Edwards
- Re: Socket recv(1) seems to block instead of returning end of file.
- Prev by Date: beginner, idiomatic python
- Next by Date: Re: Raw strings to normal strings conversion?
- Previous by thread: beginner, idiomatic python
- Next by thread: Re: Socket recv(1) seems to block instead of returning end of file.
- Index(es):
Relevant Pages
|