• 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: Distributed Objects pitfalls and strategies (SOLUTION (?))
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Distributed Objects pitfalls and strategies (SOLUTION (?))


  • Subject: Re: Distributed Objects pitfalls and strategies (SOLUTION (?))
  • From: mmalcolm crawford <email@hidden>
  • Date: Wed, 31 Mar 2004 01:13:20 -0800

On Mar 30, 2004, at 5:31 PM, John Scalo wrote:

The key here is to set the SO_REUSEADDR and *not* the SO_REUSEPORT option. This is what was killing me before. I found other references suggesting SO_REUSEPORT, but apparently they are wrong. I tried SO_REUSEADDR on a whim.

In case it might be useful for anyone else, I subsequently saw the comment in my example:

/*
By default the system does not reuse sockets. This leads to a problem if the service
is stopped and started quickly in succession. Although the socket is closed when the
service is stopped, the socket remains "in use" and by default cannot be reopened.
The following line allows the socket to be reused.
See: "UNIX Network Programming", W. Richard Stevens, p312-320
*/
int value = 1;
setsockopt(fdForListening, SOL_SOCKET, SO_REUSEADDR, &value, sizeof(int));


Sorry for not thinking about that before. Amazing what you write and then completely forget about...

mmalc
_______________________________________________
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.


References: 
 >Distributed Objects pitfalls and strategies (From: John Scalo <email@hidden>)
 >Re: Distributed Objects pitfalls and strategies (From: Aurélien Hugelé <email@hidden>)
 >Re: Distributed Objects pitfalls and strategies (SOLUTION (?)) (From: John Scalo <email@hidden>)

  • Prev by Date: Re: printing a stack trace to the console
  • Next by Date: Re: Changing subviews during drawing
  • Previous by thread: Re: Distributed Objects pitfalls and strategies (SOLUTION (?))
  • Next by thread: Re: Distributed Objects pitfalls and strategies
  • Index(es):
    • Date
    • Thread