I am a Java developer switching over to C# and have run into some interesting design problems with .Net Remoting. I am hoping someone can help.
When a client calls the server to get access to the remote object, server process activates an instance of the remote object (assume server acivated, singlton). The remote object is activated in the servers application domain and the client communicates with it through a proxy. All well and good. My goal is to create a process that will communicate with many clients, so I would like to create a queue to hold the client messages while the server processes them. If I let the singlton remote object hold this queue then I need access to it from wherever it lives (different context ). My problem is, how then do I get access to that activate instance from my main, or some other, thread
I've run though most of the basic examples around MSDN and the web. All seem to follow this pattern where the servers remote object is activate and used entirely in a contained space/context/domain. None of them implment the type of messaging I'm after.
Thanks
Ryan

Access to the activated object from Main thread
unsigned int
Check out the RemotingServices.Marshal() method.
http://msdn2.microsoft.com/en-us/library/b6fy37a8.aspx
Here's a link to a blog entry that talks about this call:
http://blogs.msdn.com/manishg/archive/2004/10/20/245312.aspx
This sample from the online help illustrates the use of this API:
TcpChannel channel = new TcpChannel(9000);
ChannelServices.RegisterChannel(channel);
SampleWellKnown objectWellKnown = new SampleWellKnown();
// After the channel is registered, the object needs to be registered
// with the remoting infrastructure. So, Marshal is called.
ObjRef objrefWellKnown = RemotingServices.Marshal(objectWellKnown, "objectWellKnownUri");
Console.WriteLine("An instance of SampleWellKnown type is published at {0}.", objrefWellKnown.URI);