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: Thu, 5 Jun 2008 13:49:25 -0400
On Jun 5, 2008, at 11:29 AM, Adi Masputra wrote:
Allow me to add another request to this. I'd like to see an API
(and KPI) to kill a connection (delete a PCB). Open Transport
(Mentat/TCP) had this and users loved it (I still get requests for
this feature). Sometimes a connection gets wedged or misbehaves
and I have yet to find a simple way in Mac OS X to get rid of it
(short of restarting the whole stack).
Can you elaborate on this? What exactly is deleting a PCB?
Imagine you just did a "netstat -a -p tcp" and got a list of active
connections.
How would you delete one of those entries?
Internally, TCP keeps a connection table as a list of PCBs. When a
connection segment arrives or a timer fires, TCP searches this list to
update the connection state. I want to remove that state entirely
because it is no longer valid. That is, delete the corresponding PCB
for that connection.
A sysctl would be fine. Presumably you would need to be executing
with privileges and would specify the local and remote endpoints. The
sysctl function ultimately dispatched would then acquire any needed
locks, walk the TCP connection table to find the matching PCB entry,
unlink it, and release it. If there was a list of partially assembled
fragments (or other resources) associated with that entry, they would
need to be released too.
- 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