Re: KPI replacement for sodisconnect?
Re: KPI replacement for sodisconnect?
- Subject: Re: KPI replacement for sodisconnect?
- From: Josh Graessley <email@hidden>
- Date: Tue, 17 May 2005 22:39:17 -0700
sock_shutdown should work fine to disconnect a TCP socket.
There is a KPI hands-on session at WWDC.
Kernel Extensions on Thursday from 2PM to 3:30PM in the Performance &
Tools lab.
<http://developer.apple.com/wwdc/labs/labs-osfoundations.html>
When you say that you are "tracking TCP state changes via access to
the raw TCP header", do you mean you look at the tcp control block?
There is no way to do that on Tiger. You can receive notification of
a number of state changes through a socket filter. What exactly are
you trying to accomplish?
-josh
On May 17, 2005, at 10:08 PM, Brian Bergstrand wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Yes, I didn't mean to imply a re-use of a TCP socket -- just if
sock_connect(INADDR_ANY) will cause a disconnect of the current
connection. Our current model issues a disconnect because it needs to
hang onto the socket for a while longer before actually closing it. I
suppose I could do a retain before the close to keep the socket
around.
I also noticed that soabort is missing a KPI replacement -- we were
using this to abort a connection in progress -- although retain/close
should work there too.
I haven't really begun exploring our TCP conversion yet, as I expect
it to be more difficult than the UDP one. For one, we are tracking
TCP state changes via access to the raw TCP header.
P.S. Is there going to be a KPI hands-on session at WWDC?
Thanks.
On May 17, 2005, at 11:37 PM, Josh Graessley wrote:
TCP sockets aren't meant to be reused liked that. Just close the
socket and open a new one for a new connection. sendto won't work
with a TCP socket either.
-josh
On May 17, 2005, at 9:32 PM, Brian Bergstrand wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Thanks Josh. Does this also work for TCP sockets or will it
return an
error since there's an actual connection state?
On May 17, 2005, at 6:42 PM, Josh Graessley wrote:
You do this the same way in the kernel you would in user space.
Connect again but specify the INADDR_ANY address (0.0.0.0). Yeah,
it's sorta weird, but that's just the way it is. You can also
connect directly to a different address.
-josh
On May 17, 2005, at 3:32 PM, Brian Bergstrand wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Am I missing something, or is there no KPI replacement for
sodisconnect()? We were using this on UDP sockets to
disassociate an
address set with soconnect().
Brian Bergstrand
<http://www.bergstrand.org/brian/> PGP Key ID: 0xB6C7B6A2
-----BEGIN PGP SIGNATURE-----
Version: PGP Desktop 9.0.1 (Build 2130)
iQA/AwUBQorFV3nR2Fu2x7aiEQJQcwCgnls3/rEqoMOvccDGZdPm+++8Qh0AoL5n
zbTB85CC9Le7a73zdziSXPGs
=zlt7
-----END PGP SIGNATURE-----
Brian Bergstrand
<http://www.bergstrand.org/brian/> PGP Key ID: 0xB6C7B6A2
-----BEGIN PGP SIGNATURE-----
Version: PGP Desktop 9.0.1 (Build 2130)
iQA/AwUBQorN8nnR2Fu2x7aiEQJukgCeIwPT9ulf3glFpX5l661bNqQf02MAn2Kz
qxVD8SBKFImIIHII5ZCKZpUP
=5KTo
-----END PGP SIGNATURE-----
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden