title: socket: constantly getting POLLHUP on half-close
body: <p>I wrote a socket server, running on linux, but this is probably not linux specifix.</p>
  
  <p>I use <code>poll()</code> to check the state of the clients. My clients do an active (half-)close after sending the request. The server constantly getting <code>POLLHUP</code> and <code>POLLERR</code>, because of the client's half-close. I also see <code>POLLRDHUP</code>, so I know that's actually half-close and not a connection close/reset. My problem is that I always get these events even though I already know from previous poll that there was a half-close.</p>
  
  <p>How can I disable this so I do not receive theis event anymore? I tried to do additional <code>read()</code> and do a <code>shutdown(fd, SHUT_RD)</code>, but it doesn't seem to help. I don't want <code>poll</code> to wake up for an event I already handled.</p>