Re: non-blocking IO EAGAIN on write

2010-07-27 Thread Lawrence D'Oliveiro
In message , Roy Smith wrote: > Consider, for example, a write on a TCP connection. You are sitting in > a select(), when the other side closes the connection. The select() > should return, and the write should then immediately fail. Remember that select can return 3 different sets of file obje

Re: non-blocking IO EAGAIN on write

2010-07-26 Thread Thomas Guettler
John Nagle wrote: > On 7/23/2010 1:45 AM, Thomas Guettler wrote: >> Hi, >> >> I use non-blocking io to check for timeouts. Sometimes I get EAGAIN >> (Resource temporarily unavailable) >> on write(). My working code looks like this. But I am unsure how many >> bytes have been written to the >> pipe

Re: non-blocking IO EAGAIN on write

2010-07-24 Thread Kushal Kumaran
- Original message - > In article , >  Kushal Kumaran wrote: > > > In general, after select has told you a descriptor is ready, the > > first write after that should always succeed. > > > > Consider, for example, a write on a TCP connection.  You are sitting in > a select(), when the ot

Re: non-blocking IO EAGAIN on write

2010-07-24 Thread John Nagle
On 7/23/2010 1:45 AM, Thomas Guettler wrote: Hi, I use non-blocking io to check for timeouts. Sometimes I get EAGAIN (Resource temporarily unavailable) on write(). My working code looks like this. But I am unsure how many bytes have been written to the pipe if I get an EAGAIN IOError. At

Re: non-blocking IO EAGAIN on write

2010-07-24 Thread Roy Smith
In article , Kushal Kumaran wrote: > In general, after select has told you a descriptor is ready, the > first write after that should always succeed. I used to think that too. Over the last few years, I've been maintaining a large hunk of cross-platform C++ code which makes heavy use of sel

Re: non-blocking IO EAGAIN on write

2010-07-23 Thread Kushal Kumaran
On Fri, Jul 23, 2010 at 2:15 PM, Thomas Guettler wrote: > Hi, > > I use non-blocking io to check for timeouts. Sometimes I get EAGAIN (Resource > temporarily unavailable) > on write(). My working code looks like this. But I am unsure how many bytes > have been written to the > pipe if I get an E

Re: non-blocking IO EAGAIN on write

2010-07-23 Thread Nobody
On Fri, 23 Jul 2010 10:45:32 +0200, Thomas Guettler wrote: > I use non-blocking io to check for timeouts. Sometimes I get EAGAIN > (Resource temporarily unavailable) on write(). My working code looks > like this. But I am unsure how many bytes have been written to the pipe > if I get an EAGAIN IOE

non-blocking IO EAGAIN on write

2010-07-23 Thread Thomas Guettler
Hi, I use non-blocking io to check for timeouts. Sometimes I get EAGAIN (Resource temporarily unavailable) on write(). My working code looks like this. But I am unsure how many bytes have been written to the pipe if I get an EAGAIN IOError. Up to now I retry with the same chunk. If I get EAGAIN