linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bogdan Cristea <cristeab@gmail.com>
To: Glynn Clements <glynn@gclements.plus.com>,
	linux-c-programming@vger.kernel.org
Subject: Re: close socket and TCP RST
Date: Wed, 11 Apr 2012 20:42:44 +0200	[thread overview]
Message-ID: <5706767.2IZuFMGXdL@desktop> (raw)
In-Reply-To: <20357.34865.112925.808959@cerise.gclements.plus.com>

On Wednesday 11 April 2012 14:33:37 you wrote:
> In many cases, shutdown() is not necessary. Normally, one side knows
> whether the other side will send more data. E.g. for (non-pipelined)
> HTTP, the client sends a request, the server sends a response, then
> closes the connection.

It is exactly what he does, but the question is how to close the connection so 
that the client receives the last message. 
He is using for this:

 err = setsockopt(sockfd, SOL_SOCKET, SO_LINGER, &lin, sizeof(lin));

but for some reason it does not work as it should.
-- 
Bogdan 

  reply	other threads:[~2012-04-11 18:42 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-09 23:46 close socket and TCP RST Celelibi
2012-04-10 21:01 ` Bogdan Cristea
2012-04-11  0:38   ` Celelibi
2012-04-11 13:33 ` Glynn Clements
2012-04-11 18:42   ` Bogdan Cristea [this message]
2012-04-11 23:31     ` Glynn Clements
2012-04-13  1:54       ` Celelibi
2012-04-13  1:37   ` Celelibi
2012-04-13  7:32     ` Glynn Clements
2012-04-14 15:37       ` Celelibi
2012-04-14 16:13         ` Glynn Clements
2012-04-15  0:41           ` Celelibi
2012-04-16 20:43             ` Glynn Clements

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=5706767.2IZuFMGXdL@desktop \
    --to=cristeab@gmail.com \
    --cc=glynn@gclements.plus.com \
    --cc=linux-c-programming@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).