예제 #1
0
파일: KcpClient.cs 프로젝트: dora-BYR/Fenix
 public void stop()
 {
     foreach (var ukcp in _channelManager.getAll())
     {
         ukcp.notifyCloseEvent();
     }
     _executorPool?.stop(false);
     if (_eventLoopGroup != null && !_eventLoopGroup.IsShuttingDown)
     {
         Task.Run(() => _eventLoopGroup?.ShutdownGracefullyAsync());
     }
 }
예제 #2
0
파일: KcpServer.cs 프로젝트: dora-BYR/Fenix
 /**
  * 同步关闭服务器
  */
 public void stop()
 {
     foreach (var channel in _localAddress)
     {
         channel.CloseAsync().Wait();
     }
     foreach (var ukcp in _channelManager.getAll())
     {
         ukcp.notifyCloseEvent();
     }
     _eventLoopGroup?.ShutdownGracefullyAsync();
     _executorPool?.stop(false);
 }
예제 #3
0
 public void stop()
 {
     foreach (var ukcp in _channelManager.getAll())
     {
         ukcp.close();
     }
     _executorPool?.stop(false);
     if (_eventLoopGroup != null && !_eventLoopGroup.IsShuttingDown)
     {
         _eventLoopGroup?.ShutdownGracefullyAsync().Wait();
     }
     _scheduleThread.stop();
 }
예제 #4
0
 /**
  * 同步关闭服务器
  */
 public void stop()
 {
     foreach (var channel in _localAddress)
     {
         //channel.CloseAsync().Wait();
         Task.Run(() => channel.CloseAsync()).Wait();
     }
     foreach (var ukcp in _channelManager.getAll())
     {
         ukcp.close();
     }
     _eventLoopGroup?.ShutdownGracefullyAsync();
     _executorPool?.stop(false);
     _scheduleThread.stop();
 }
예제 #5
0
        /**
         * 同步关闭服务器
         */
        public async Task stop()
        {
            foreach (var channel in _localAddress)
            {
                //channel.CloseAsync().Wait();
                await channel.CloseAsync();
            }
            foreach (var ukcp in _channelManager.getAll())
            {
                ukcp.close();
            }

            if (_eventLoopGroup != null)
            {
                await _eventLoopGroup.ShutdownGracefullyAsync();
            }
            _executorPool?.stop(false);
            _scheduleThread.stop();
        }