Re: Deleting a TCP connection in Mac OS X
Re: Deleting a TCP connection in Mac OS X
- Subject: Re: Deleting a TCP connection in Mac OS X
- From: Peter Sichel <email@hidden>
- Date: Fri, 6 Jun 2008 09:30:44 -0400
On Jun 5, 2008, at 4:01 PM, Vincent Lubet wrote:
You cannot remove a TCP control block from beneath an open socket.
TCP must have some way of removing a connection entry when it is no
longer needed. If the socket is linked to the PCB, then it will be
necessary to find the corresponding socket.
I still don't understand by what you mean by "remove that state
entirely because it is no longer valid" as the TCP control block is
a data structure that is internal to the TCP implementation which is
the only one who knows about the validity of the control block...
In one case, the connection is already half closed by the local client
and the remote peer is is not responding so TCP keeps retransmitting a
FIN segment waiting for an ACK that will never come. Normally this is
harmless and will time out eventually, but sometimes having a bunch of
these gets in the way of something else and it would be nice to have a
way to clear them out.
In another case, the connection is wedged spewing traffic back and
forth with a peer that isn't syncing up (whether by accident or
intent). The connection is out of control sucking up bandwidth and
you just want to stop it without unplugging your Ethernet.
[Admittedly as a network developer I spend more time than most testing
weird combinations.]
A third case might be a firewall that has detected you are under
attack and wants to shut a connection down.
Are you looking for a way to close a TCP connection used by another
application?
Yes, although the application may have tried to close the connection
already. The assumption that internal TCP state is always valid and
well behaved has not always been true in my experience. Where "valid"
refers to whether TCPs internal model and behavior reflects the users
intent.
Kind Regards,
- Peter
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden