[Mono-dev] Remoting Server Events problem

buhochileno at gmail.com buhochileno at gmail.com
Sat Nov 24 22:11:24 EST 2007


I know that is very possible that this is a basic remoting question, but 
I read some info about the native .NET approach used with remoting and I 
think that my code is supose it to work:

I write a class with a method to trigger some event (this is the object 
resgitered by the remoting server):
public class Camera: MarshalByRefObject
   public void SetZoom(int amount)
   {...//zoom code
       SomeDelegate h = this.SomeEvent; //some test event triger, the 
SomeDelegate is public...
       if ((h != null) && (SomeEvent != null))
               h (this, new EventArgs());
               Console.WriteLine("null then?"); //allways is null
...On the client side I use a special "RemoteCamera", this class deal 
with all the remoting stuff related to get the object from the 
server...something like:
public class RemoteCamera: MarshalByRefObject
       public RemoteOrbitKit()
       { .../channel registration, etc...
           camera.SomeEvent += new SomeDelegate(SomeMethod);
            camera.SetZoom(50); //this work, but the event is not 

       public SomeMethod(object sender, EventArgs e)
            Console.WriteLine("method called"); //This methis is never 
called becouse the Event/method asociation allways is null

Do you see what is my mistake?
sugestions?, ideas?


Greeting, Mauricio

P.D: Sorry is I post this twice, but the mail server of the list tell me 
that some parts of the message are ignored or not proseced...¿?

More information about the Mono-devel-list mailing list