netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* SO_LINGER dead: I get an immediate RST on 2.6.24?
@ 2009-01-11 21:23 bert hubert
  2009-01-11 22:08 ` H. Willstrand
  0 siblings, 1 reply; 23+ messages in thread
From: bert hubert @ 2009-01-11 21:23 UTC (permalink / raw)
  To: netdev

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

^ permalink raw reply	[flat|nested] 23+ messages in thread
* Re: sendfile()? Re: SO_LINGER dead: I get an immediate RST on 2.6.24?
@ 2009-01-13  6:32 Herbert Xu
  2009-01-13  6:56 ` Bill Fink
  0 siblings, 1 reply; 23+ messages in thread
From: Herbert Xu @ 2009-01-13  6:32 UTC (permalink / raw)
  To: billfink; +Cc: ilpo.jarvinen, zbr, bert.hubert, h.willstrand, netdev

Bill Fink <billfink@mindspring.com> wrote:
>
> If I understand you correctly, to hit this corner case, just after
> the final TCP write, there would have to be no packets in flight
> together with a zero TCP window.  To make it more bullet-proof, I
> guess after seeing a zero tcpi_unacked, an additional small delay
> should be performed, and then rechecking for a zero tcpi_unacked.
> I don't see anything else obvious (to me anyway) in the tcp_info
> that would be particularly helpful in handling this.

What's wrong with idiag_wqueue? Isn't that a much more direct
way to get this?

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2009-02-20 18:11 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

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).