Skip navigation.
 
mlHandling NSConnection death gracefully
FROM : Dan Bernstein
DATE : Sat Apr 09 23:32:26 2005

I have a Distributed Objects "server" object that receives various
objects over NSConnections. Whenever it gets an object it "cares"
about (e.g. an object that gets assigned to an ivar) it wants to be
notified when that object's connection dies. This is easy: register
for NSConnectionDidDieNotification. The problem is, when the
notification comes, there's no direct way to know why the server
registered for it, i.e. which objects that it "cares" about are
affected by the connection's death.

My current idea is to go over [[deathNotification object]
remoteObjects] and for each one check (by pointer comparison) if it's
one of the objects I care about.

I'm looking for a neater solution.

Thanks,
-- Dan

Related mailsAuthorDate
No related mails found.