/// <summary> /// 停止 /// </summary> public static async Task Stop() { await Task.WhenAll( bootstrapChannel.CloseAsync(), bossGroup.ShutdownGracefullyAsync(TimeSpan.FromSeconds(1), TimeSpan.FromSeconds(2)), workerGroup.ShutdownGracefullyAsync(TimeSpan.FromSeconds(1), TimeSpan.FromSeconds(2))); LOGGER.Info("tcp server stoped"); }
public void Close() { try { _channel.CloseAsync(); } catch (Exception ex) { } }
protected override Task DoCloseAsync() { return(_channel.CloseAsync()); }