Inheritance: DisposableBase
Exemplo n.º 1
0
 /// <summary>
 /// Stops the server.
 /// </summary>
 internal static void Stop()
 {
     lock(_syncRoot)
     {
         DisposableBase.DisposeOf(_server);
         _server = null;
     }
 }
Exemplo 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();
 }
Exemplo 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();
     }
 }