Re: Using NSSocketPort, NSConnection, Distributed Objects, and threads...
Re: Using NSSocketPort, NSConnection, Distributed Objects, and threads...
- Subject: Re: Using NSSocketPort, NSConnection, Distributed Objects, and threads...
- From: Douglas Davidson <email@hidden>
- Date: Tue, 8 Nov 2005 12:48:15 -0800
On Nov 8, 2005, at 10:20 AM, Allan Dushan wrote:
I understand that you need to send the message
enableMultipleThreads: to your NSConnection to allow threading to
be handled correctly, and I do send this message to both the server
and client NSConnection objects when I set them up, but... when I
manually setup an NSSocketPort using
initWithProtocolFamily:socketType:protocol:socket:,
enableMutlipleThreads: no longer works. If I use initWithTCPPort:,
everything works fine. So you might be asking why then don't I just
use initWithTCPPort:? Because, I need to set socket options
especially the SO_REUSEADDR option so that I don't have to wait
forever to reconnect to a server were the connection was not shut
down properly, due to the server crashing or some other issue.
I'm not sure exactly what is going wrong in your case, but you can
use initWithTCPPort: and then call -socket to obtain the socket so
that you can set SO_REUSEADDR on it.
Douglas Davidson
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden