I’ve read man 2 kqueue but have not found out how I can get notified about a socket hangup or exceptional condition of the socket without registering it with EVFILT_READ or EVFILT_WRITE. Apart from this it is not fully clear how kqueue signals exceptional states of sockets altogether.
Thanks for your answer in advance.
A trick that can be used to get EOL events while ignoring all READ events is to supply a ridiculously high value to NOTE_LOWAT, thus suppressing all READ events.
Here’s an example doing this in a Python REPL:
Moreover, there is no such thing as exceptional state on FreeBSD, to quote
man 2 select: