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(); }
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); }
public static void Stop() { ProccessGuard.Release(); ServerUtilities.SafeReleaseChannel(channel); }