Re: How can one remote a thread-bound MarshalByRefObject

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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



.



Relevant Pages

  • Re: Color Test - Try it. I cant do it. :(
    ... I tried it but somehow can't get a perfect score. ... What's the trick? ... those professional sportsmen and women apparently giving well over 100% ...
    (uk.people.silversurfers)
  • Re: mainlining min-configs...
    ... make K=my_mini_config allnoconfig ... Somehow yes. ... The K= notation I hope will see more use. ... people know the KCONFIG_ALL*CONFIG= trick. ...
    (Linux-Kernel)
  • Re: Double Leg wrap Comp
    ... I wasnt expecting my first time of doing a trick to be perfect. ... Somehow it got tinted, which is weird. ... Ill load it again so its colored ...
    (rec.sport.unicycling)
  • Re: magnavox 26md357
    ... troubles with this unit i am thinking maybe circuit issues. ... somehow. ... is there a trick to this or can i just keep lifting the back ...
    (sci.electronics.repair)
  • Re: Color Test - Try it. I cant do it. :(
    ... I tried it but somehow can't get a perfect score. ... What's the trick? ... But all I could get was 88%, as you said, Wrinklie. ...
    (uk.people.silversurfers)