Making an NSConnection from a BSD socket
Making an NSConnection from a BSD socket
- Subject: Making an NSConnection from a BSD socket
- From: John Scalo <email@hidden>
- Date: Thu, 25 Mar 2004 17:39:29 -0800
I need to set some options on a BSD socket via setsockopt before
binding it (otherwise setsockopt has no effect). I then want to use
this socket to create an NSConnection. Is there any way to create an
NSConnection from a BSD socket rather than an NSSocketPort? Or some way
to turn a raw BSD socket into an NSSocketPort after it's created via
socket() but before bind() ? The problem with using NSSocketPorts is
that when you initialize them, they also get bound so there's no chance
to set any socket options.
BTW, the option I'm setting is SO_REUSEPORT so that if the process dies
with an active connection, it won't take 10 minutes before a new
process can create a new connection with the same port #. It sure would
be nice if NSSocketPort had an initWithTCPPort: options: method!
Thanks!
~ John
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.