• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Using NSSocketPort, NSConnection, Distributed Objects, and threads...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Using NSSocketPort, NSConnection, Distributed Objects, and threads...
      • From: Allan Dushan <email@hidden>
References: 
 >Using NSSocketPort, NSConnection, Distributed Objects, and threads... (From: Allan Dushan <email@hidden>)

  • Prev by Date: Re: CFUserNotificationCreate does not work from daemon started via launchd
  • Next by Date: Re: Understanding [NSTextview setInsertionPointColor:]
  • Previous by thread: Using NSSocketPort, NSConnection, Distributed Objects, and threads...
  • Next by thread: Re: Using NSSocketPort, NSConnection, Distributed Objects, and threads...
  • Index(es):
    • Date
    • Thread