*BSD News Article 60802


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!news.bhp.com.au!mel.dit.csiro.au!munnari.OZ.AU!news.hawaii.edu!ames!hookup!usenet.eel.ufl.edu!brutus.bright.net!chi-news.cic.net!newsxfer2.itd.umich.edu!gatech!psinntp!psinntp!psinntp!psinntp!clothos.candle.com!phobos.candle.com!main.elgin.candle.com
From: mevans@candle.com
Newsgroups: comp.unix.bsd.freebsd.misc,comp.os.linux.development.apps
Subject: Re: Checking for a closed socket connection
Date: Mon, 29 Jan 96 22:03:34
Organization: Candle Corporation
Lines: 7
Message-ID: <4ek59s$mb5@phobos.Candle.Com>
NNTP-Posting-Host: 198.210.58.236
X-Newsreader: IBM WebExplorer DLL 
Xref: euryale.cc.adfa.oz.au comp.unix.bsd.freebsd.misc:13355 comp.os.linux.development.apps:11722

If a TCP socket is opened as SOCK_STREAM, (the normal case), then the concept of '0 length
packets' doesn't appy at the application layer.  Stream sockets have no concept of packet boundaries,
a send of 0 bytes would be an effective NOP, resulting in no actual network traffic.  That's
why recv is free to return 0 as a unique indicator of stream termination.  Detecting stream
termination during outbound operations in where a lot of implementation defined behavior comes
into play.  A send to a broken stream socket on AIX typically results in ECONNRESET, sometimes
ETIMEDOUT, on OS/2, it's always EPIPE, and so on ...