private void StartRemoteServer() { remotableObject = new RouteRemoteObject(); TcpChannel channel = new TcpChannel(ConstDefine.REMOTE_PORT); ChannelServices.RegisterChannel(channel); RemotingConfiguration.RegisterWellKnownServiceType(typeof(RouteRemoteObject), ConstDefine.REMOTE_NAME, WellKnownObjectMode.Singleton); }
private void Remote() { TcpChannel chan = new TcpChannel(); ChannelServices.RegisterChannel(chan); // Create an instance of the remote object RouteRemoteObject remoteObject = (RouteRemoteObject)Activator.GetObject(typeof(RouteRemoteObject), "tcp://localhost:" + ConstDefine.REMOTE_PORT + "/" + ConstDefine.REMOTE_NAME); List <string> list = remoteObject.Search(new List <string>(), new List <string>(), 4, 91, 62, 1, 1, 1, 1); Console.WriteLine(list[0]); }