lkml.org 
[lkml]   [2001]   [Oct]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: close() sends an RST
From
Date
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.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:08    [W:0.057 / U:3.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site