From: akr@... Date: 2020-01-28T02:03:20+00:00 Subject: [ruby-core:97010] [Ruby master Feature#16597] missing poll() Issue #16597 has been updated by akr (Akira Tanaka). As far as I know, it is impossible for TCP because shutdown(SHUT_RD) and close() doesn't notify it to the other end of the connection if no unread data. (Please point out me if I'm wrong.) poll() doesn't help for this problem with TCP. (An approximation is getsockopt(TCP_INFO) for Linux which can be used to investigate TCP state of a connection.) I'm not sure for pipe but kernel knows that the other end is closed or not. What the event flag of poll() you want to use? https://pubs.opengroup.org/onlinepubs/9699919799/functions/poll.html ---------------------------------------- Feature #16597: missing poll() https://bugs.ruby-lang.org/issues/16597#change-84097 * Author: michals (Michal Such�nek) * Status: Open * Priority: Normal * Assignee: * Target version: ---------------------------------------- When using a socket or a pipe for writing select() cannot determine that the socket is closed. It tells you that it is ready to write but if you don't have data to write you cannot tell that it is in fact closed. ruby internally uses poll() which can tell when a write socket is closed (without attempting a write()) but presents the broken select() interface. -- https://bugs.ruby-lang.org/ Unsubscribe: