Socket recv(1) seems to block instead of returning end of file.




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


.



Relevant Pages

  • Re: Socket recv(1) seems to block instead of returning end of file.
    ... While doing a netstring implementation I noticed that if you ... then when you shut the remote end down you do not ... The transmit side seems to give a broken pipe error, ... I am using stock standard SuSe 10, Python 2.4, out of the box. ...
    (comp.lang.python)
  • Re: Simple signal transmission using long steel pipe
    ... The remote device incorporates a sensor which produces a simple ... to transmit a sigal without any signal boosters ... and commands are transmitted acoustically through the liquid. ... substantial acoustic impedance mismatch between the liquid and the pipe ...
    (sci.electronics.design)
  • Re: one channel radio frequency help
    ... simply detect the presence of an IR signal oscillating at around 40 Khz, ... A typical IR remote would modulate that carrier by turning it on ... RF remotes are similar, in that instead of a 40 Kz carrier on an IR LED, ... If you can bother you can find chips that do both the transmit and receive ...
    (sci.electronics.design)
  • Re: Simple signal transmission using long steel pipe
    ... The remote device incorporates a sensor which produces a simple ... to transmit a sigal without any signal boosters ... simple and cheap solution. ... ear to the pipe) and a couple of cell phones. ...
    (sci.electronics.design)
  • Re: Simple signal transmission using long steel pipe
    ... The remote device incorporates a sensor which produces a simple ... to transmit a sigal without any signal boosters ... If the pipe can be grounded at both ends, ... generator and an audio amp at the drive end, ...
    (sci.electronics.design)