public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andi Kleen <ak@muc.de>
To: oliver.kowalke@t-online.de
Cc: linux-kernel@vger.kernel.org
Subject: Re: close() sends an RST
Date: 16 Oct 2001 23:59:09 +0200	[thread overview]
Message-ID: <k2r8s3i6vm.fsf@zero.aec.at> (raw)
In-Reply-To: <1003222233.3bcbf4d957274@webmail.t-online.de>
In-Reply-To: oliver.kowalke@t-online.de's message of "Tue, 16 Oct 2001 10:57:29 +0200 (MEST)"

In article <1003222233.3bcbf4d957274@webmail.t-online.de>,
oliver.kowalke@t-online.de writes:
> Hi,
> I've following programmed: an tcp-server waits on select() for readable 
> and writeable socket-handles. The client writes something to the server 
> and reads its response and then calls close() for its connected socket. 
> On the server site select() returns and indicates the socket as 
> readable. The function read() returns with error ECONNRESET which 
> indicates an RST send from the client. Because the client terminated as 
> excpected (write()->read()->close()) I assume close() has send an RST 
> instead of an FIN?! Is this correct or what happend? 

close will send an RST if there is still unread data on the local side.
This is to signal the other end that there has been data lost.
You probably need to fix your server to read all data upto eof.

-Andi

p.s.: this is kind of a FAQ; it's probably already documented somewhere.

           reply	other threads:[~2001-10-16 21:59 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <1003222233.3bcbf4d957274@webmail.t-online.de>]

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=k2r8s3i6vm.fsf@zero.aec.at \
    --to=ak@muc.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oliver.kowalke@t-online.de \
    /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