Mailing List archive

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

[vdr] Re: how detect vdr has closed socket in c++?



Am Montag, 16. Februar 2004 20:46 schrieb Guido Fiala:
> As to allow to set a small SVDRP-timeout without kvdr loosing a command -
> how to detect if vdr has closed the socket?
>
> I tried to check errno after calling write(), but this helps just after the
> second write()-operation on the socket and then it's too late.
> Some other way i missed?

Well, not sure if this is the cleanest way, but I usually try if a socket is 
signalled for reading (means poll for read returns true on this socket), and 
if a subsequent read returns 0, that signals eof, meaning the socket is 
closed (at least for reading, but this usually is enough).

Greetings,
Sascha



-- 
Info:
To unsubscribe send a mail to ecartis@linuxtv.org with "unsubscribe vdr" as subject.



Home | Main Index | Thread Index