Article View: comp.sys.next.programmer
Article #151Re: Need help with Distributed Objects
From: Paul Tognato-Haddad
Date: Thu, 05 Nov 1992 02:45
Date: Thu, 05 Nov 1992 02:45
66 lines
2821 bytes
2821 bytes
In article <1992Nov4.164157.4447@afs.com> writes:
> 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.
>
I eventually figured out the problem(thanks to Sam Steeper@next). My
server wasn't an application, so things weren't getting initialized
correctly by the program. The fix was to add the following line to my
code.
[NXPort worryAboutPortInvalidation];
This forks a new thread that waits for the invalidation messages, which
has fixed the problem.
However I still have a problem with the program, that noone seemed to have
answered. Here is the rest of the original post detailing the problem.
When the server dies I would like
the client to wait 10 minutes and then try to connect again. Here's what
I do
-senderIsInvalid:sender
{
[serverConnection free];
[self connect:self];
return self;
}
Unfortunatelly all that seems to happen when I do this is the following
error in the console.
Oct 23 18:03:46 nextus netmsgserver[60]: netname_main.msg_send fails, kr =
-102.
So what am I doing wrong now? I guess the original connection isn't
getting disconnect for some reason, but I am fresh out of ideas on how to
make it work.
Thanks in advance.
--
Paul (NeXTmail preferred)
Anyone who is capable of getting themselves made President should on no
account be allowed to do the job.
-- Douglas Adams, "The Hitchhiker's Guide to the Galaxy"
Technical Details
Message-ID:
<1992Nov4.194550.3942@arizona.edu>Path:
arc1-ca.pugleaf.net!sparky!uunet!charon.amdahl.com!pacbell.com!decwrl!sun-barr!cs.utexas.edu!zaphod.mps.ohio-state.edu!rphroy!caen!destroyer!ncar!noao!arizona!arizona.edu!arizona.edu!newsReferences:
<1992Nov4.164157.4447@afs.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!charon.amdahl.com!pacbell.com!decwrl!sun-barr!cs.utexas.edu!zaphod.mps.ohio-state.edu!rphroy!caen!destroyer!ncar!noao!arizona!arizona.edu!arizona.edu!news From: paul@nextus.tucson.az.us (Paul Tognato-Haddad) Newsgroups: comp.sys.next.programmer Subject: Re: Need help with Distributed Objects Message-ID: <1992Nov4.194550.3942@arizona.edu> Date: 5 Nov 92 02:45:47 GMT References: <1992Nov4.164157.4447@afs.com> Distribution: world,local Lines: 66 Nntp-Posting-Host: nextus.tucson.az.us