/// <summary>
        /// Opens a remote service that remote programs can connect (subscribe) to.
        /// </summary>
        /// <param name="service"></param>
        public RemoteService(IRemoteService service, int port)
        {
            //Starting network-layer
            this.m_InternalService = service;
            this.m_Communicator    = new TcpCommunicator <BoxedObject>("127.0.0.1", port)
            {
                DispatchMessageInEvent = true,
            };
            this.m_Communicator.Open();
            this.m_Communicator.MessageReceived += M_Communicator_MessageReceived;

            //Getting all methodinfos in the start
            this.m_ServiceMethods = service.GetType().GetMethods(BindingFlags.Public | BindingFlags.Instance).Where(mi => mi.IsSpecialName == false).ToArray();
        }
예제 #2
0
 public TypeInfoProvider(IRemoteService service) : this(service.GetType())
 {
 }