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}"); } } }
/// <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); } }
/// <summary> /// 关闭 /// </summary> public void Close() { this.resetEvent.Reset(); server.Close(); }