• 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: Closing Distributed Object connections
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Closing Distributed Object connections


  • Subject: Re: Closing Distributed Object connections
  • From: Wade Tregaskis <email@hidden>
  • Date: Thu, 9 Oct 2003 17:34:48 +1000

> So in step 5, for the first few minutes the NSConnection you are
> trying to create is returned nil. This could be what you are referring
> to when you say there is a known bug in which ports cannot be reused
> immediately after being closed. In this case it is true, but in the
> example where the clients processes have quit completely before the
> server quits, there is no delay in creating the new NSConnection on
> the same port (ie switch steps 3 and 4 in the example above).

Ah, okay. So if you invalidate an NSConnection while it's still being
used (remotely), it doesn't invalidate it's ports until some time later
- presumably some sort of time out.

> An aside - I find this a bit annoying, it would be nice if the client
> would be notified if a connection was invalidated, rather than having
> to wait for a timeout exception.
> I take a quote from the documentation of NSConnection's
> NSConnectionDidDieNotification
>
> "An NSConnection object attached to a remote NSSocketPort object
> cannot detect when the remote port becomes invalid, even if the remote
> port is on the same machine. Therefore, it cannot post this
> notification when the connection is lost. Instead, you must detect the
> timeout error when the next message is sent."

I think this is very stupid too. I know that you can detect when the
remote side closes a tcp connection, because I've seen it happen in
Carbon applications. It seems OpenTransport was intelligent enough for
this, whereas BSD sockets are not. Then again, I was under the
impression that OpenTransport was implemented as a layer over BSD
sockets...hmmm.

What should be done is that the closing side of the connection should
send a message indicating such, at the DO-protocol level. This would
overcome the apparent sockets bug.

Wade Tregaskis
-- Sed quis custodiet ipsos custodes?
_______________________________________________
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: 
 >Re: Closing Distributed Object connections (From: Joji Mori <email@hidden>)

  • Prev by Date: Re: NSString from Palm text?
  • Next by Date: Re: CFRunLoop usage
  • Previous by thread: Re: Closing Distributed Object connections
  • Next by thread: Some small utility for Mac OS X.
  • Index(es):
    • Date
    • Thread