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