*BSD News Article 69144


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!news.mira.net.au!news.mel.connect.com.au!news.uwa.edu.au!disco.iinet.net.au!news.uoregon.edu!vixen.cso.uiuc.edu!newsfeed.internetmci.com!newsxfer2.itd.umich.edu!tank.news.pipex.net!pipex!usenet1.news.uk.psi.net!uknet!dispatch.news.demon.net!demon!microl4.microlise.UUCP!news
From: andrewg@microlise.co.uk  (Andrew Gierth)
Newsgroups: comp.unix.bsd.misc,comp.unix.sys5.r4,comp.unix.programmer
Subject: Re: TCP socket close() behavior (Was: Imcomplete Documents and Images from httpd)
Date: 22 May 1996 18:19:32 GMT
Organization: Microlise Engineering Ltd.
Lines: 30
Message-ID: <4nvlrk$6kl@microl4.microlise.UUCP>
References: <319b6555@yoda.omnicron.com> <4nkuav$q54@noao.edu> <31a1f624@yoda.omnicron.com> <4ntd43$mn1@noao.edu>
Reply-To: andrewg@microlise.co.uk  (Andrew Gierth)
NNTP-Posting-Host: andrewg.microlise.uucp
X-NNTP-Posting-Host: microl.demon.co.uk
X-Newsreader: IBM NewsReader/2 v1.2
Xref: euryale.cc.adfa.oz.au comp.unix.bsd.misc:1094 comp.unix.sys5.r4:11009 comp.unix.programmer:37702

[comp.unix.programmer added by me]

In <4ntd43$mn1@noao.edu>, rstevens@noao.edu (W. Richard Stevens) writes:
>> I submit for discussion the question of whether the kernel must attempt
>> to deliver pending sent data when a close() is performed on a connected
>> TCP socket without the SO_LINGER option enabled.
>>[snip]
>> Is there any more authoritative documentation for this aspect of sockets
>> semantics?  Is the httpd software "wrong" to omit the SO_LINGER option?
>
>Posix.1g, Draft 6.3 states "A normal disconnect initiated by closing a
>TCP socket with the SO_LINGER option disabled or with a linger time other
>than zero shall not cause data to be discarded" (p. 278).  That's pretty
>explicit, and I maintain is the "existing practice".
>
>       Rich Stevens

So what does happen if you set a linger time other than 0 and close the
socket, and the linger time is reached? I know many implementations
ignore the actual time specified, is that conforming? If the time is
*not* ignored, and is reached, what precisely is supposed to happen?

[where does one get hold of Posix drafts?]

-- Andrew (andrewg@microlise.co.uk)

"Usenet is like a herd of performing elephants with diarrhea; massive,
difficult to redirect, awe-inspiring, entertaining, and a source of 
mind-boggling amounts of excrement when you least expect it."