• 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: NSConnection via NSSocketPort
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSConnection via NSSocketPort


  • Subject: Re: NSConnection via NSSocketPort
  • From: John Anderson <email@hidden>
  • Date: Sat, 15 Jun 2002 16:31:32 -0700

That does indeed seem to be the issue, but I can't seem to find anything in the Cocoa/Foundation classes to address this problem.

Any ideas on what I should do here?

John Anderson


On Friday, June 14, 2002, at 10:57 AM, Cameron Hayne wrote:

John Anderson <email@hidden> wrote:
I've got a client server solution that uses NSSocketPort-based
NSConnections to connect clients and servers over TCP/IP. All is fine
and dandy except that sometimes, when I quit and restart my server
application quickly, I can't set aside a port.

While I wouldn't have recognized it from the error messages you got, the problem you described is a common one in socket programming. The socket stays busy for a certain time after it is closed in case there is still some data coming in that was delayed in transit. You can read about this on the UNIX Socket FAQ page at:
http://www.developerweb.net/sock-faq/
It is explained (in probably too much detail) in the answer to the question "Please explain the TIME_WAIT state".
One possible solution is via the socket option SO_REUSEADDR. (See the question "What exactly does SO_REUSEADDR do?"

... Cameron
--
Cameron Hayne (email@hidden)
Hayne of Tintagel
_______________________________________________
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.

  • Follow-Ups:
    • Re: NSConnection via NSSocketPort
      • From: Cameron Hayne <email@hidden>
References: 
 >Re: NSConnection via NSSocketPort (From: Cameron Hayne <email@hidden>)

  • Prev by Date: Re: Protecting Software w/ Software License Keys...
  • Next by Date: Re: Protecting Software w/ Software License Keys...
  • Previous by thread: Re: NSConnection via NSSocketPort
  • Next by thread: Re: NSConnection via NSSocketPort
  • Index(es):
    • Date
    • Thread