Connection management

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Thu, 04 Jun 1998 01:15:16 +0200

--MimeMultipartBoundary
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

When playing around with large requests the old "TCP Reset" issue comes
to my mind again. We haven't done much to prevent them when closing
client connections.

Proposal on how to close client connection without TCP Reset:

When we want to close the connection:
  * shutdown() our sending side
  * Set TCP Receive window to something small (setsockopt SO_RCVBUF)
  * Set remaining lifetime to ~30 seconds (max 2 minutes)
Then:
  * Keep listenning for a client-side close (read() == 0), and close the
socket immediately if seen.
  * Defer reading if read more than 1K, to avoid wasting bandwith, but
don't close the connection (there may be a error message that we should
let throught to the client).

SO_LINGER does nothing to help this as the receiving side is shut down
even whan SO_LINGER is enabled, and even if it keeps the receiver open
until all data is acknowledged it does not guard us against evil TCP
Resets (data is received by the receivers TCP, but not yet sent to the
application, which tries to send something to us).

/Henrik

--MimeMultipartBoundary--
Received on Tue Jul 29 2003 - 13:15:50 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:11:48 MST