Ejemplo n.º 1
0
        public void stop()
        {
            Stopped = true;

            if (mSelector != null)
            {
                try
                {
                    mSelector.Close();
                    mSelector = null;
                }
                catch (Java.IO.IOException ex)
                {
                    Debug.Fail($"TcpProxyServer mSelector.close() catch an exception: {ex}");
                }
            }

            if (mServerSocketChannel != null)
            {
                try
                {
                    mServerSocketChannel.Close();
                    mServerSocketChannel = null;
                }
                catch (Java.IO.IOException ex)
                {
                    if (AppDebug.isDebug)
                    {
                        ex.PrintStackTrace();
                    }

                    Debug.Fail($"TcpProxyServer mServerSocketChannel.close() catch an exception: {ex}");
                }
            }
        }
Ejemplo n.º 2
0
 /// <exception cref="System.IO.IOException"/>
 public virtual void Close()
 {
     bossGroup.ShutdownGracefully();
     workerGroup.ShutdownGracefully();
     if (sslFactory != null)
     {
         sslFactory.Destroy();
     }
     if (externalHttpChannel != null)
     {
         externalHttpChannel.Close();
     }
     try
     {
         infoServer.Stop();
     }
     catch (Exception e)
     {
         throw new IOException(e);
     }
 }
Ejemplo n.º 3
0
 /// <summary>
 /// 关闭
 /// </summary>
 public void Close()
 {
     this.resetEvent.Reset();
     server.Close();
 }