've got a client app that communicates to a server EXE via Remoting
(TCP/Binary Serializer). Most of the time things work just smashingly
except that at seemingly random times a call to the server process
will fail with the following exception:
"... RemotingException: Requested Service not found" . Seems easy
enough, the server is not running or has not established the endpoint
you might say. The problem is the server is running and the endoint
is established. Not only that, but the following are true as well:
---------------
- The server activated object reference has already had a number of
successful method invocations performed on it
- The lease is infinite on the object
- The server side call stack shows the call failing in the guts of the
remoting code:
"Server stack trace: at
System.Runtime.Remoting.Channels.BinaryServerFormatterSink.ProcessMessage(IServerChannelSinkStack
sinkStack, IMessage requestMsg, ITransportHeaders requestHeaders,
Stream requestStream, IMessage& responseMsg, ITransportHeaders&
responseHeaders, Stream& responseStream)"
- When the exception occurs, no more successful calls can be made on
the remoted object reference from the existing client app, but if I
launch another client app instance and make method invocations on
another SAO they work just fine
------------
I find it interesting that the call actually makes it to the server
side but I still get the "Requested Service not found" message.
The parameters of the methods are mostly simple types, with a few that
are structs that contain simple types (strings, ints, etc). On the
client side, the remoting channel is established by registering the
well-known-type of server objects in the app.config.
I've tried to create a small set of sample code to reproduce the issue
but I've haven't been able to do so.
There are only two things that seem suspect to me:
1. there is a possibilty of a method being invoked on the same object
simultaneously from two different threads. This theory hasn't really
panned out because logs show that this never happens in practice (even
live logs from when the exception occurs)
2. some of the objects whose methods we invoke are actually not
objects that are explicitly listed as well-known-types in the
app.config, but are merely instances that are returned from methods of
a remoted class. e.g:
class RemotedClass
{
public SecondaryClass GetSecondaryObject()
{
return new SecondaryClass();
}
}
I'm unclear as to what the lease policy and object disposition (SAO or
CAO) of objects returned from a remoted object's methods would be.
I've exhausted my options w/r/t Google/docs/FAQ searches, so I was
wondering if anyone else had ever seem similar behavior, or might have
an explanation as to why my remoted object reference seems to go dead.
Mike
--
http://hole19.compurhythms.com