Ejemplo n.º 1
0
 public void StopServer()
 {
     RemoveAllClients();
     ChannelServices.UnregisterChannel(_httpChannel);
     _server = null;
     _isListening = false;
 }
Ejemplo n.º 2
0
 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;
 }