*BSD News Article 60470


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!news.mel.connect.com.au!munnari.OZ.AU!spool.mu.edu!howland.reston.ans.net!news.nic.surfnet.nl!tuegate.tue.nl!news.win.tue.nl!charm.il.ft.hse.nl!not-for-mail
From: robert@il.ft.hse.nl (Robert Klep)
Newsgroups: comp.unix.bsd.freebsd.misc,comp.os.linux.development.apps
Subject: Re: Checking for a closed socket connection
Date: 25 Jan 1996 11:15:51 +0100
Organization: LSD...melts in your mind, not in your hand
Lines: 8
Message-ID: <4e7l8n$50f@charm.il.ft.hse.nl>
References: <NEWTNews.822505959.29723.jalvarez@sundev.uno.com>
NNTP-Posting-Host: charm.il.ft.hse.nl
Xref: euryale.cc.adfa.oz.au comp.unix.bsd.freebsd.misc:13111 comp.os.linux.development.apps:11461

jalvarez@uno.com:
 >Is there a simple way to test a socket descriptor for a closed
 >connection (e.g. if the connection to the other side was lost
 >and is no longer valid) ?

read() to/write() from it and see if the function returns a -1 :)

                                                                robert