> > Data CAN be lost if the TCP connection is RST. It has nothing to > > do with the ordering of accept() with respect to close(). > > Please educate me: how would RST come into this discussion at all? > The client does connect() write() close(), there is no forced > connection termination involved at all. > > Wietse If you set the SO_LINGER socket option, a close() may generate RST and discard socket buffers/TCP state, as opposed to the standard behavior of keeping the data around and resending until the data and the FIN are acknowleged by the other end. I am not sure why this is supposed to be a good idea, though, but obviously, if you set that option, you are unconcerned about data loss, or you have already guarded against it with application-level acknowledgment. Let's agree: it is okay for accept to return an error code indicating the connection has already been terminated, so long as any data sent by the client (such that the client had every indication that it was received) is still available for the acceptor to read. -Jon To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-net" in the body of the message
- Re: [[email protected]: accept(2) behavior with tcp RST r... Jonathan Lemon
- Re: [[email protected]: accept(2) behavior with tcp RST r... Jonathan Lemon
- Re: [[email protected]: accept(2) behavior with tcp RST r... Jonathan Lemon
- Re: [[email protected]: accept(2) behavior with tcp RST r... itojun
- Re: [[email protected]: accept(2) behavior with tcp RST r... Jonathan Lemon
- Re: [[email protected]: accept(2) behavior with tcp RST r... Jonathan Lemon
- Re: [[email protected]: accept(2) behavior with tcp RST r... itojun
- Re: [[email protected]: accept(2) behavior with tcp RST r... Jonathan Lemon
- Re: [[email protected]: accept(2) behavior with tcp RST r... Jonathan Lemon
- RE: [[email protected]: accept(2) behavior with tcp RST r... Jonathan Graehl
- RE: [[email protected]: accept(2) behavior with tcp ... Jonathan Graehl
- Re: [[email protected]: accept(2) behavior with tcp RST r... Jonathan Lemon
- Re: [[email protected]: accept(2) behavior with tcp RST r... Alfred Perlstein
- Re: [[email protected]: accept(2) behavior with tcp ... Jonathan Lemon
- Re: [[email protected]: accept(2) behavior with tcp RST r... itojun
- Re: [[email protected]: accept(2) behavior with tcp ... Jonathan Lemon
