On Wed, 2007-07-04 at 17:39 +0200, Eric Dumazet wrote: > On Thu, 05 Jul 2007 01:09:54 +1000 > > That all seems OK to me .. but the problem is losing > > data in the transmit queue, not the receive queue. > > RST is full-duplex, and forbids further data transmit. What you seem to be saying is that sockets are fundamentally screwed and cannot possibly work in non-blocking mode, (or in blocking mode without SO_LINGER). All I want to do is write some data down a socket and then close the socket, without blocking .. and it can't be done? I mean, it's fine if the kernel tries to write the data for a while and fails .. it's not fine if you can't close a socket without flushing the transmit queue, because there's no way to tell when the transmit queue is empty. Delaying the close (which is what our software actually does) is a non-solution, because a lot of sockets could be stuck waiting for a timeout even when the transmit queue is empty. reading all the input data is also, clearly, a non-solution (it's at least protocol dependent, and at worst would lead to a DNS attack opportunity if the client either failed to send a FIN, or sent data continuously). Hmm ... -- John Skaller <skaller at users dot sf dot net> Felix, successor to C++: http://felix.sf.net - To unsubscribe from this list: send the line "unsubscribe linux-net" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html