public void StopServer() { RemoveAllClients(); ChannelServices.UnregisterChannel(_httpChannel); _server = null; _isListening = false; }
public void StartServer() { _httpChannel = new HttpServerChannel(_channelName, _port); //RemotingConfiguration.Configure(httpChannel, false); ChannelServices.RegisterChannel(_httpChannel, false); RemotingConfiguration.RegisterWellKnownServiceType(typeof(SingletonServer), _channelName, WellKnownObjectMode.Singleton); _server = (SingletonServer)Activator.GetObject(typeof(SingletonServer), _host + ":" + _port.ToString() + "/SingletonServer"); _isListening = true; }