Open nemo9955 opened 5 years ago
I don't think your fcntl call would work, as a socket is not a file. In general, once a call to recv(2)
returns 0, you can expect the socket to be closed/the connection to have been terminated.
If you really need to detect a closed stream without reading anything from the socket, you can use epoll: the EPOLLRDHUP
event flag should indicate the situation you're looking for.
I want to be notified or at least check periodically if a
libsocket::inet_stream
created by alibsocket::inet_stream_server::accept()
is closed. I triedfcntl
but it does not seem to work.