Re: How can one remote a thread-bound MarshalByRefObject
- From: Bern McCarty <bern.mccarty@xxxxxxxxxxx>
- Date: Thu, 29 Sep 2005 12:02:26 -0700
Hello Robert,
I was planning on using that very trick, but I cannot see how to get myself into the position of employing it in the first place. Somehow, for any thread-bound MBRO type that I might be inclined to serve up, I need to get my own code insinuated into a place on the server side where I am handed the invocation information (method and arguments) so that I can create a delegate from that information and pass it to Control.Invoke.
I don't want to have to create additional glue-code each time that I wish to expose a new type/method pair for remoting. I figure that someplace in all of the pieces of the .NET remoting puzzle there is a place I can put some very generic code and catch everything and forward it over to the required thread. I just don't know how.
I've experimented with creating an interposing instance of a RealProxy-derived-class on the server and then dynamically publishing that interposing instance. I can't quite seem to get it. I actually have end-to-end method invocation taking place successfully even though the Invoke method on my RealProxy-derived class is not called when a successful remote method call is made. Somehow my RealProxy derived instance is cut out of the loop even though that is what I published.
-Bern
Hi,
What's the difference? I have a MarshalByRefObject that will only behave correctly if it is accessed on a particular thread. Think System.Windows.Forms.Control or any HWND. They are all thread-bound things. I happen to have such a thing of my own. How do I best remote it?
For SWF Controls there is a simple solution: use Control.Invoke or .BeginInvoke. If you can afford a (hidden) window and a message pump, you can use that "trick" in any context. If you cannot have a window, you must use some kind of thread synchronization (AutoResetEvent) to pass control to the thread where the object lives.
Rob
.
- Follow-Ups:
- Re: How can one remote a thread-bound MarshalByRefObject
- From: Robert Jordan
- Re: How can one remote a thread-bound MarshalByRefObject
- References:
- Re: How can one remote a thread-bound MarshalByRefObject
- From: Robert Jordan
- Re: How can one remote a thread-bound MarshalByRefObject
- Prev by Date: HTTP download of assemblies has been disabled for this appdomain.
- Next by Date: Remoting (TCP) channels and multiple clients
- Previous by thread: Re: How can one remote a thread-bound MarshalByRefObject
- Next by thread: Re: How can one remote a thread-bound MarshalByRefObject
- Index(es):
Relevant Pages
|