From: "H. Willstrand" <h.willstrand@gmail.com>
To: bert hubert <bert.hubert@netherlabs.nl>, netdev@vger.kernel.org
Subject: Re: SO_LINGER dead: I get an immediate RST on 2.6.24?
Date: Sun, 11 Jan 2009 23:08:16 +0100 [thread overview]
Message-ID: <175f5a0f0901111408s7905e5d9l2155b841f1ac054d@mail.gmail.com> (raw)
In-Reply-To: <20090111212303.GA8612@outpost.ds9a.nl>
On Sun, Jan 11, 2009 at 10:23 PM, bert hubert <bert.hubert@netherlabs.nl> wrote:
> Hi everybody,
>
> I have an application where I need to send data from A to B, and beforehand,
> I don't know how much data this will be.
>
> B is 'stupid', and consists solely of a TCP/IP port accepting data, and I
> have no way to chunk this data. So what I do is issue blocking calls to
> write(), shutdown(fd, SHUT_WR), and wait for the fd to become readable which
> tells me that the remote has packed up, and I'm good to go.
>
> Before this, I've tried SO_LINGER with various timeouts but nothing helped.
>
> When I tcpdump, I find that my close() is immediately turned into an RST
> packet.
>
> Is SO_LINGER a NOOP? Does it still do anything?
>
> I'm about to blog this up - the 'shutdown() and read()' technique is
> something I had to purloin from the Apache source.
>
> So I'd love to know the words of the wise on this one.
>
> Thanks.
>
> --
> http://www.PowerDNS.com Open source, database driven DNS Software
> http://netherlabs.nl Open and Closed source services
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
This is the correct behavior according to RFC 2525, see section 2.17
(there are an example).
//H.W.
next prev parent reply other threads:[~2009-01-11 22:08 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-11 21:23 SO_LINGER dead: I get an immediate RST on 2.6.24? bert hubert
2009-01-11 22:08 ` H. Willstrand [this message]
2009-01-11 22:45 ` sendfile()? " bert hubert
2009-01-11 22:54 ` Evgeniy Polyakov
2009-01-11 23:08 ` bert hubert
2009-01-11 23:18 ` Evgeniy Polyakov
2009-01-12 4:50 ` Bill Fink
2009-01-12 9:18 ` Ilpo Järvinen
2009-01-13 5:31 ` Bill Fink
2009-02-13 17:02 ` Jeremy Jackson
2009-02-20 18:10 ` Bill Fink
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=175f5a0f0901111408s7905e5d9l2155b841f1ac054d@mail.gmail.com \
--to=h.willstrand@gmail.com \
--cc=bert.hubert@netherlabs.nl \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).