コード例 #1
0
        private void OnDisconnection(RakNet.Packet packet, RakPeerInterface server, string reason)
        {
            logger.Trace("Disconnected from endpoint {0}", packet.systemAddress);
            var c = RemoveConnection(packet.guid);

            server.DeallocatePacket(packet);

            _handler.CloseConnection(c, reason);

            var action = ConnectionClosed;

            if (action != null)
            {
                action(c);
            }

            if (c != null)
            {
                var a = c.ConnectionClosed;
                if (a != null)
                {
                    a(reason);
                }
            }
        }
コード例 #2
0
        private void OnDisconnection(RakNet.Packet packet, RakPeerInterface server, string reason)
        {
            _logger.Trace("transports.raknet", "{0} disconnected", packet.systemAddress);

            var c = RemoveConnection(packet.guid);

            server.DeallocatePacket(packet);
            _handler.CloseConnection(c, reason);
            c.RaiseConnectionClosed(reason);

            var action = ConnectionClosed;

            if (action != null)
            {
                action(c);
            }
        }
コード例 #3
0
 public void CloseConnection()
 {
     _connectionManager.CloseConnection();
 }
コード例 #4
0
ファイル: HubClient.cs プロジェクト: TomeQ2k/_Smile
        public async override Task OnDisconnectedAsync(Exception exception)
        {
            await connectionManager.CloseConnection(Context.ConnectionId);

            await base.OnDisconnectedAsync(exception);
        }
コード例 #5
0
        public async Task <CloseConnectionResponse> Handle(CloseConnectionRequest request, CancellationToken cancellationToken)
        {
            await connectionManager.CloseConnection(request.HubName);

            return(new CloseConnectionResponse());
        }
コード例 #6
0
 private void Close()
 {
     _connectionManager.CloseConnection();
 }