[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.remoting

Restart of client application

kashif

9/9/2004 12:35:00 PM

Hi All
i had a little bit tricky scenario
I have a server apoplication eposing remote object ,
Oject is used by client application and client object is passed as proxy to
server using callback mechanism

Now every thing works fine but after some time (in this time their is no
communication b/w server & CLIENT) calling method on client object by server
results in exception 9service not available).

So wats a way to increase lifetime of proxy object to remain for ever even
their is no communication
secondly how i can check that proxy is still refer to some remote object (
To know either server is running or not)

thanks in advance

kashif
Programmer


2 Answers

Ken Kolda

9/10/2004 3:05:00 PM

0

You need to override the InitializeLifetimeServices() method in your client
object. You can return NULL if you wish the object to live indefinitely.

Of course, this doesn't resolve the issue of the client being stopped and
your server having a reference to a now-inaccessible object. What you need
to do is make sure that when you invoke the proxy you are catching any
exceptions that may arise due to the disconnect. If the client is
disconnected, the server should drop the proxy it's holding. There is no
built-in call to detect is the proxy is still connected to a client object
(plus, even if there were, there's no guarantee the client wouldn't die
between the time of this call and the time you invoke the actual callback
method).

Ken


"kashif" <kashif.kazi@gonetbpo.com> wrote in message
news:e75nsTylEHA.592@TK2MSFTNGP11.phx.gbl...
> Hi All
> i had a little bit tricky scenario
> I have a server apoplication eposing remote object ,
> Oject is used by client application and client object is passed as proxy
to
> server using callback mechanism
>
> Now every thing works fine but after some time (in this time their is no
> communication b/w server & CLIENT) calling method on client object by
server
> results in exception 9service not available).
>
> So wats a way to increase lifetime of proxy object to remain for ever even
> their is no communication
> secondly how i can check that proxy is still refer to some remote object (
> To know either server is running or not)
>
> thanks in advance
>
> kashif
> Programmer
>
>


kashif

9/29/2004 5:33:00 AM

0

Thanks Ken
i got resolved my issue by returning NULL by overridinG
InitializeLifetimeService() method as dictated by u
Thanks again
Regards

"Ken Kolda" <ken.kolda@elliemae-nospamplease.com> wrote in message
news:%23PZ$we0lEHA.3632@TK2MSFTNGP09.phx.gbl...
> You need to override the InitializeLifetimeServices() method in your
client
> object. You can return NULL if you wish the object to live indefinitely.
>
> Of course, this doesn't resolve the issue of the client being stopped and
> your server having a reference to a now-inaccessible object. What you need
> to do is make sure that when you invoke the proxy you are catching any
> exceptions that may arise due to the disconnect. If the client is
> disconnected, the server should drop the proxy it's holding. There is no
> built-in call to detect is the proxy is still connected to a client object
> (plus, even if there were, there's no guarantee the client wouldn't die
> between the time of this call and the time you invoke the actual callback
> method).
>
> Ken
>
>
> "kashif" <kashif.kazi@gonetbpo.com> wrote in message
> news:e75nsTylEHA.592@TK2MSFTNGP11.phx.gbl...
> > Hi All
> > i had a little bit tricky scenario
> > I have a server apoplication eposing remote object ,
> > Oject is used by client application and client object is passed as proxy
> to
> > server using callback mechanism
> >
> > Now every thing works fine but after some time (in this time their is
no
> > communication b/w server & CLIENT) calling method on client object by
> server
> > results in exception 9service not available).
> >
> > So wats a way to increase lifetime of proxy object to remain for ever
even
> > their is no communication
> > secondly how i can check that proxy is still refer to some remote object
(
> > To know either server is running or not)
> >
> > thanks in advance
> >
> > kashif
> > Programmer
> >
> >
>
>