[lkml]   [2001]   [Oct]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: close() sends an RST
In article <>, 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.


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
More majordomo info at
Please read the FAQ at

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