SVDRP ignores EOF (clientside close)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 19 Jul 2006 16:35:27 +0200, Stefan Lucke wrote
> Quoting Frank Schmirler <vdr@xxxxxxxxxxxx>:
> 
> > On Wed, 19 Jul 2006 14:20:26 +0200, Stefan Lucke wrote
> > > But safe_read() has to be modified, as socket is non-
> > > blocking (oldflags |= O_NONBLOCK;), EAGAIN should be handled too:
> >
> > Before safe_read() select() is called through file.Ready(). So EAGAIN should
> > not occur with SVDRP. But of course you're right if safe_read() is intended to
> > be called for nonblocking IO without prior select().
> >
> 
> But select() on files with O_NONBLOCK is like a noop according to this:
> 
> http://man.linuxquestions.org/index.php?query=select&type=2&section=2
> 
>        Three independent sets of descriptors are  watched.   Those 
>  listed  in       readfds will be watched to see if characters 
> become available for read-       ing (more precisely, to see if a 
> read will not block - in particular, a       file  descriptor	 is 
> also ready on end-of-file), those in writefds will       be watched 
> to see if a write will not block,  and  those	 in  exceptfds       
> will  be	 watched  for  exceptions.   On exit, the sets are modified 
> in       place to indicate which descriptors actually changed status.
> 
> as with O_NONBLOCK a read would never block :-) .

This is from the posix standard IEEE Std 1003.1 definition of select():

"A descriptor shall be considered ready for reading when a call to an input
function with O_NONBLOCK clear would not block, whether or not the function
would transfer data successfully. (The function might return data, an
end-of-file indication, or an error other than one indicating that it is
blocked, and in each of these cases the descriptor shall be considered ready
for reading.)"

Cheers,
Frank


[Index of Archives]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Util Linux NG]     [Xfree86]     [Big List of Linux Books]     [Fedora Users]     [Fedora Women]     [ALSA Devel]     [Linux USB]

  Powered by Linux