Carlos E. Hernandez
8/7/2004 11:04:00 AM
I searched and didnt found a post for zombie object, do you have the post??
Thanks for all, its been a great help.
"Sunny" <sunny@newsgroups.nospam> wrote in message
news:ezjgZsYeEHA.3428@TK2MSFTNGP11.phx.gbl...
> Hi,
>
> In article <e3v0alXeEHA.3348@TK2MSFTNGP09.phx.gbl>,
> carlos@integrasofthn.com says...
> > About the last question, is there
> > a way I can know if a client is connected or if the server connection is
> > still active. When using remoting, are the client and server connected
> > always?, or they connect as the calls are made.. Thanks.
>
> It depends on the channel. If the channel is some custom-made (there are
> a lot of examples for channels using MSMQ, or even emails :) ) you may
> have, or may not have a permanent connection. The build-in channels
> (Http and Tcp) there is permanent connection, but there is no mechanism
> with the build-in channels to inform you that the connection is broken
> at the moment it breaks.
>
> There are a couple of options:
>
> 1. from server side - the lifetime of the object. You can use
> ITrackingHandler interface to be notified when the lifetime of an object
> expires, so you will know the client no longer use it.
> 2. start a new thread and in it ping some callback method on the client.
> If a ping fails, the client is gone.
>
> 3. At client side, just put all your remote invocations in try/catch
> block, and examine the reason of the exception. If you detect a network
> error, you'll know the connection is gone.
>
> There is a little problem with the last method and the TCP channels. If
> the connection brakes, it will hang for a very long time. There is no
> way how you specify the network timeout value for TCP channel. Search in
> this newsgroup for a post "zombie object". I have post there a solution
> for this.
>
> Sunny