[IronPython] Remoting: Marshal object

Ralph Soons ralph.soons.asml at hotmail.com
Tue Jun 20 17:04:02 CEST 2006


I have a remoting problem again. I want to create an object at server side, 
as singleton so when a call is done at client side, ill get the already 
existing object. I tried it first with a c# server and client.

Can anyone tell me why the marshal function doesn't work, objects on server 
and client side are still different (same code works in c# application so 
configuration is correct):

Client side (Python):
t = RemotingServerClient.CallbackSink.Instance
System.Runtime.Remoting.RemotingServices.Marshal(t, 'TalkIsGoodToo')

Server side (c#):
CallbackSink.Instance.Send("Message");

Remotable object (c#):
public class CallbackSink : MarshalByRefObject
    {
        private static CallbackSink m_Instance = null;
        public event delCommsInfo OnHostToClient;

        public static CallbackSink Instance
        {
            get
            {
                if (null == m_Instance)
                {
                    m_Instance = new CallbackSink();
                }
                return m_Instance;
            }
        }

        private CallbackSink()
        { }

        public void Send(string message)
        {
            OnHostToClient(info);
        }
    }

Thanks for your help.
Best regards,
Ralph Soons

_________________________________________________________________
Talk with your online friends with MSN Messenger 
http://www.join.msn.com/messenger/overview




More information about the Ironpython-users mailing list