private void _resource_OnReceived(object sender, PeerCommandEventArgs e)
        {
            try
            {
                lock (_activeConnections)
                {
                    var command = _serializer.Deserialize(e.Data);
                    if (!string.IsNullOrEmpty(command.UserId))
                    {
                        lock (_responceWaiters)
                        {
                            TaskCompletionSource<Command> taskSource;
                            if (_responceWaiters.TryGetValue(new Tuple<string, CommandName>(command.UserId, command.Name),
                                out taskSource))
                            {
                                taskSource.TrySetResult(command);
                            }
                        }
                    }

                    var user = _userRepository.FirstMatching(UserSpecifications.UserId(command.UserId));
                    RemoteUser remoteUser;
                    if (user != null)
                    {
                        var existedConnection = _activeConnections.FirstOrDefault(i => i.User.Equals(user));
                        if (existedConnection != null)
                        {
                            existedConnection.Peer = e.Peer;
                            existedConnection.Peer.HandleActivity();
                            remoteUser = existedConnection;
                        }
                        else
                        {
                            remoteUser = new RemoteUser(user, e.Peer);
                        }
                        _activeConnections.Add(remoteUser);
                    }
                    else
                    {
                        remoteUser = new RemoteUser(new User(), e.Peer);
                        _activeConnections.Add(remoteUser);
                    }
                    CommandRecieved(this, new RemoteUserCommandEventArgs { Command = command, RemoteUser = remoteUser });
                }
            }
            catch (Exception exc)
            {
                Logger.Exception(exc, "_resource_OnReceived");
            }
        }
 void _transport_Received(object sender, PeerCommandEventArgs e)
 {
     try
     {
         lock (_responseWaiters)
         {
             var command = _serializer.Deserialize(e.Data);
             TaskCompletionSource<Command> taskSource;
             if (_responseWaiters.TryGetValue(command.PacketId, out taskSource))
             {
                 taskSource.TrySetResult(command);
             }
         }
     }
     catch (Exception)
     {
         //Log
     }
 }