示例#1
0
        public static void Start()
        {
            channel  = ServerUtilities.GetTcpChannel("Agency" + "Channel", port, 100);
            Instance = new RemoteAgency();
            RemotingServices.Marshal(Instance, "Agency");
            ChannelDataStore store = channel.ChannelData as ChannelDataStore;

            Url = store.ChannelUris[0];
            System.Diagnostics.Trace.WriteLine("RemoteAgency\t listen at:" + Url);

            ProccessGuard.LaunchAgentProcess();
        }
示例#2
0
        public static RemoteAgent Regist(string id, string address)
        {
            if (instance != null)
            {
                return(instance);
            }

            RemoteAgency agent;

            ServerUtilities.GetTcpChannel();
            agent    = Activator.GetObject(typeof(RemoteAgency), address) as RemoteAgency;
            instance = new RemoteAgent()
            {
                Id = id
            };
            agent.Regist(id, instance);
            return(instance);
        }
示例#3
0
 public static void Stop()
 {
     ProccessGuard.Release();
     ServerUtilities.SafeReleaseChannel(channel);
 }