From owner-freebsd-questions Wed Sep 22 18:40:50 1999 Delivered-To: freebsd-questions@freebsd.org Received: from laurasia.com.au (lauras.lnk.telstra.net [139.130.93.142]) by hub.freebsd.org (Postfix) with ESMTP id 7EEE714F9F for ; Wed, 22 Sep 1999 18:40:45 -0700 (PDT) (envelope-from mike@laurasia.com.au) Received: (from mike@localhost) by laurasia.com.au (8.9.3/8.9.3) id JAA06903 for freebsd-questions@freebsd.org; Thu, 23 Sep 1999 09:40:44 +0800 (WST) (envelope-from mike) From: Michael Kennett Message-Id: <199909230140.JAA06903@laurasia.com.au> Subject: Poll() syscall with sockets To: freebsd-questions@freebsd.org Date: Thu, 23 Sep 1999 09:40:44 +0800 (WST) X-Mailer: ELM [version 2.4ME+ PL54 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Hello, I have a question about the behaviour of the poll() system call with sockets. I'd like to detect when the remote end of the connection has been dropped, and I was thinking that the poll() call would return the event POLLHUP when the socket is closed. However, this doesn't seem to be the case! Currently, I'm detecting the closure of the socket by detecting the POLLRDNORM event, and reading 0 bytes, which seems to be a bit of a work- around. Is this an accepted way of detecting closure of a socket? Thanks in advance, Mike Kennett To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message