Hi Monica,
it seems that you are using TCP channels. The problem is that you can
not control the timeout for TCP channels for now. I think MS are
planning to implement it in the future version of the framework.
So, it does not hang forever, but for some time, like 2-3 minutes.
A possible workarround is at client side to create a delegate to the
remote object function, and to invoke that delegate async, with
BeginInvoke and then to wait a specific time for the method to finish.
.... I'm skipping the delegate creation ....
IAsyncResult ar;
ar = deleg.BeginInvoke(....)
if (!ar.AsyncWaitHandle.WaitOne(5000, false))
{
//here we know that method have not returned in 5 seconds
}
else
{
//method success
}
Hope that helps
Sunny
In article <O7gn8FS$DHA.3184@TK2MSFTNGP09.phx.gbl>, hm@nre.com says...
[quoted text, click to view] > A zombie remote object?
>
> I have a console application that hosts a remote object.
> Case a) When I Ctrl-C this host and the client request something from this
> remote object,
> the client wait forever or until a Ctrl-C.
> example:
>
> ...
> ObjMgr = (IObjManager) Activator.GetObject(typeof(IObjManager), url);
> result = ObjMgr.GetSomething(objectID); <--- here wait forever
> ...
>
> Case b) When the console application finishes normally and the client
> requests something,
> the client receives the following error message:
>
> [System.Net.Sockets.SocketException]
> "No connection could be made because the target machine actively refused it"
> At this point the client knows that the remote object is not more active and
> can react appropriately.
>
> Question about case a)
> What happens here that the client does not receive this error message ?
> How can the client recognize that the remote object is not available ?
>
> I really appreciate your answer.
> Thanks in advance.
>
>
>