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++?



On Tue, 2004-02-17 at 20:28, Guido Fiala wrote:
> -checked return-value and errno after write
> -select for read after write and checked errno here
> -select before write and a read (i can only read 0 bytes, as i don't expect 
> any byte actually there)
> -write(fd,temp,0) just before the real write - still no error
> 
> The behaviour is, that only the second write that fails is actually producing
> the error at the socket, write() returns an error and errno is set...
> 
> Any other thing to try?

If you used poll(2), then a closed socket would be signaled by either
- POLLIN with read() returning 0: end of file
- POLLHUP: connection closed
- POLLERR: erroneous state
(if I remember correctly)

Regards,
Andreas



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



Home | Main Index | Thread Index