From: Evgeniy Polyakov <zbr@ioremap.net>
To: bert hubert <bert.hubert@netherlabs.nl>,
"H. Willstrand" <h.willstrand@gmail.com>,
netdev@vger.kernel.org
Subject: Re: sendfile()? Re: SO_LINGER dead: I get an immediate RST on 2.6.24?
Date: Mon, 12 Jan 2009 01:54:27 +0300 [thread overview]
Message-ID: <20090111225427.GA7004@ioremap.net> (raw)
In-Reply-To: <20090111224541.GA10848@outpost.ds9a.nl>
Hi Bert.
On Sun, Jan 11, 2009 at 11:45:43PM +0100, bert hubert (bert.hubert@netherlabs.nl) wrote:
> Is there any way to make sure there is no pending output data, so one can
> safely call close(), and not get an RST-situation?
You can try to work with tcp cork options, uncorking the socket means
that stack has sent data to the hardware, there are no other guarantees.
> Let me put it more succinctly. What I would very much like to have is what
> Linux sendfile() offers in practice.
>
> It appears that if one asks sendfile() to transmit a million bytes, it will
> only return when the ACK for the millionth byte is in.
No it is not, it returns when it believes it has sent all the requested
data, but in practice it can be even not sent but waiting in some
hardware queue.
> I know that TCP will never be fully fully reliable, but I would love to have
> a way to know that the millionth byte was ACKed, or alternatively, that an
> error prevented that.
There is no way to get a notification when data is acked by the remote
side. Generally you should invent some kind of own explicit acks.
--
Evgeniy Polyakov
next prev parent reply other threads:[~2009-01-11 22:54 UTC|newest]
Thread overview: 23+ 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
2009-01-11 22:45 ` sendfile()? " bert hubert
2009-01-11 22:54 ` Evgeniy Polyakov [this message]
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
-- strict thread matches above, loose matches on Subject: below --
2009-01-13 6:32 Herbert Xu
2009-01-13 6:56 ` Bill Fink
2009-01-13 7:01 ` Herbert Xu
2009-01-14 7:43 ` Bill Fink
2009-01-14 8:29 ` Herbert Xu
2009-01-14 9:05 ` Bill Fink
2009-01-14 11:30 ` Herbert Xu
2009-01-15 6:33 ` Bill Fink
2009-01-13 7:06 ` Rick Jones
2009-01-14 8:05 ` Bill Fink
2009-01-14 8:08 ` Rick Jones
2009-01-14 8:32 ` 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=20090111225427.GA7004@ioremap.net \
--to=zbr@ioremap.net \
--cc=bert.hubert@netherlabs.nl \
--cc=h.willstrand@gmail.com \
--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).