🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.next.programmer
Article #150

Re: Need help with Distributed Objects

#150
From: jaime_guerrero
Date: Wed, 04 Nov 1992 16:41
32 lines
2290 bytes
In article <1992Oct23.190817.3885@arizona.edu> paul@nextus.tucson.az.us (Paul  
Tognato-Haddad) writes:
|  I'm writing a program that uses distributed objects, but am having a  
|  couple problems with it.  The first problem is how to know when the client  
|  application dies.

In addition to sending self to -registerForInvalidationNotification:, a server  
needs to sent self to -setDelegate: so that it receives  
-connection:didConnect: messages in addition to -senderIsInvalid: messages.

When it gets a -connection:didConnect: message, send a  
-registerForInvalidationNotification to the *NEW* connection, otherwise you  
won't be notified when client connections fail.

In your -senderIsInvalid: method, scan your list of client proxies and test  
whether their -connectionForProxy matches sender.  If so, that is the client  
that failed.

WARNING: be careful if you maintain your list of client proxies in a  
HashTable.  Due to the fact that HashTable sends a -hash message to  
object-type keys and Distributed Objects forwards these to the real object  
like any other message, strange inexplicable "proxy is invalid" errors result  
when a new client connects to the server *after* another client has died.  The  
solution: If you have a HashTable keyed on client proxies, make sure you  
initKeyDesc: it with "i"; so that hashing is done without using the -hash  
method which is forwarded to the client.

--
Jaime F. Guerrero                               "How well do we use
Anderson Financial Systems, Inc.                 The freedom to choose
Springhouse, PA, USA                             The illusions we create?"
jaime_guerrero@afs.com  [NeXTmail receptive]      -Timbuk 3
Technical Details
Message-ID: <1992Nov4.164157.4447@afs.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!charon.amdahl.com!pacbell.com!decwrl!sdd.hp.com!zaphod.mps.ohio-state.edu!darwin.sura.net!europa.asd.contel.com!paladin.american.edu!news.univie.ac.at!hp4at!mcsun!sunic!psinntp!psinntp!afs!jaime
References: <1992Oct23.190817.3885@arizona.edu>

Show Full Headers
Complete Article Headers
Newsgroups: comp.sys.next.programmer
Path: arc1-ca.pugleaf.net!sparky!uunet!charon.amdahl.com!pacbell.com!decwrl!sdd.hp.com!zaphod.mps.ohio-state.edu!darwin.sura.net!europa.asd.contel.com!paladin.american.edu!news.univie.ac.at!hp4at!mcsun!sunic!psinntp!psinntp!afs!jaime
From: jaime_guerrero@afs.com
Subject: Re: Need help with Distributed Objects
Message-ID: <1992Nov4.164157.4447@afs.com>
Sender: jaime@afs.com
Reply-To: jaime_guerrero@afs.com
References: <1992Oct23.190817.3885@arizona.edu>
Distribution: world,local
Date: Wed, 4 Nov 1992 16:41:57 GMT
Lines: 32