Inheritance: DisposableBase
Esempio n. 1
0
 /// <summary>
 /// Stops the server.
 /// </summary>
 internal static void Stop()
 {
     lock(_syncRoot)
     {
         DisposableBase.DisposeOf(_server);
         _server = null;
     }
 }
Esempio n. 2
0
 private void Start()
 {
     Debug.Assert(_server == null);
     _server = new TcpServer(
         endpoint: ServiceConfiguration.Server.Endpoint,
         handler: new ProxySessionManager(CreateReader()),
         backlog: ServiceConfiguration.Server.ConnectionBacklog);
     _server.Start();
 }
Esempio n. 3
0
 private void RunCore(IMessageReader reader, IPEndPoint endpoint, int connectionBacklog)
 {
     using(var server = new TcpServer(
         endpoint: endpoint ?? new IPEndPoint(IPAddress.Any, ProxyMessageReader.DefaultPort),
         handler: new ProxySessionManager(reader),
         backlog: connectionBacklog))
     {
         server.Start();
         CmdLineCancelKey.WaitFor().Dispose();
     }
 }