On Sun, 22 Dec 2019 23:44:33 +0300 Valery Ushakov <[email protected]> wrote:
> LOL. Sorry :) I mean, you are already using poll(2). It literally > cannot get *any* worse. Literally. The margins of this email are > just too narrow... Sorry again, traumatic memories... > > E.g. NetBSD and Solaris never report POLLHUP for sockets. Windows and > OSX report POLLHUP when remote half-closes. Linux reports it on full > close. NetBSD and Solaris don't report POLLERR on failed connect(2), > just POLLOUT. And I don't even want to think about scenarios like > reset after half-close... > Well, I don't have problems with poll(). For a small number of file descriptors it works quite well. Yes it does get expensive when you start using 1000s of file descriptors, but then you just use epoll(), kqueue(), etc. Actually, kqueue() is very awkward to use and in my opinion, is not designed very well. > On NetBSD you always get SIGPIPE (whn not turned off), right? If I remember correctly, on NetBSD sometimes I got ECONNRESET, sometimes I got SIGPIPE, depending on at what time the other TCP application was killed. On Linux I think I always got ECONNRESET.
