示例#1
0
        /// <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");
        }
示例#2
0
 public void Close()
 {
     try
     {
         _channel.CloseAsync();
     }
     catch (Exception ex)
     {
     }
 }
示例#3
0
 protected override Task DoCloseAsync()
 {
     return(_channel.CloseAsync());
 }