1 Oct 2010 11:08
Re: Early FIN/close for query-response TCP connections like DNS's
Stefanos Harhalakis <v13 <at> v13.gr>
2010-10-01 09:08:16 GMT
2010-10-01 09:08:16 GMT
On Friday 01 of October 2010, David P. Reed wrote: > TCP endpoint stacks are not part of IETF standards. In particular > "socket" calls and their meaning are not standardized. Of course. I don't suggest any change required in any point in the underlying stack. Only a suggestion for implementations of DNS/TCP clients. > I suspect that there might be a problem here in the actual *stacks* > because to "half close" a connection, one issues a "close" to the > socket. After such a command, many operating systems may not expect to > provide more data on the receive side. In fact one has to use shutdown() instead of close(). From what I understand, close() closes the socket, while shutdown handles the connection leaving the socket fd valid. > I suppose you could signal a half-close without an operating system > close by some kind of ioctl call (in Linux type OS's). In OS's like > Symbian and DOS/Windows, etc., there may be some "control" operation > that one can call. However it would be decidedly non-standard for the > client to close when it expects more data. In linux it works fine. You only have to shutdown() the socket with how=SHUT_WR. Here's the tcpdump of a test where a client sends 10K data and receives 10K data while the server receives 10K data, sleeps for 1 second and sends 10K data. The client half closes the connection after it finishes write()ing: Connect/Accept: 11:38:57.908427 IP 127.0.0.1.44572 > 127.0.0.1.9996: Flags [SEW], seq(Continue reading)
RSS Feed