public void Run(ClientCommandArgs args)
        {
            var receivedContent = Serializer.Deserialize <MessageContent>(args.Message);

            if (receivedContent.RemoteInfo == null)
            {
                throw new ArgumentNullException("info");
            }

            if (receivedContent.RequestPoint == null)
            {
                throw new ArgumentNullException("request point");
            }

            if (receivedContent.SenderPoint == null)
            {
                throw new ArgumentNullException("sender point");
            }

            ClientModel.Peer.WaitConnection(receivedContent.SenderPoint);

            var sendingContent = new ServerP2PReadyAcceptCommand.MessageContent
            {
                PeerPoint    = receivedContent.RequestPoint,
                ReceiverNick = receivedContent.RemoteInfo.Nick
            };

            using (var client = ClientModel.Get())
                sendingContent.RemoteInfo = client.User;

            ClientModel.Client.SendMessage(ServerP2PReadyAcceptCommand.Id, sendingContent);
        }
        protected override void OnRun(MessageContent content, ClientCommandArgs args)
        {
            if (content.RemoteInfo == null)
            {
                throw new ArgumentNullException("info");
            }

            if (content.RequestPoint == null)
            {
                throw new ArgumentNullException("request point");
            }

            if (content.SenderPoint == null)
            {
                throw new ArgumentNullException("sender point");
            }

            ClientModel.Peer.WaitConnection(content.SenderPoint);

            var sendingContent = new ServerP2PReadyAcceptCommand.MessageContent
            {
                PeerPoint    = content.RequestPoint,
                ReceiverNick = content.RemoteInfo.Nick
            };

            using (var client = ClientModel.Get())
                sendingContent.RemoteInfo = client.User;

            ClientModel.Client.SendMessage(ServerP2PReadyAcceptCommand.CommandId, sendingContent);
        }
        protected override void OnRun(MessageContent content, CommandArgs args)
        {
            if (content.RemoteInfo == null)
            {
                throw new ArgumentNullException("content.RemoteInfo");
            }

            var senderPoint = new IPEndPoint(new IPAddress(content.SenderIpAddress), content.SenderPort);

            ClientModel.Peer.WaitConnection(senderPoint);

            var sendingContent = new ServerP2PReadyAcceptCommand.MessageContent
            {
                PeerPort      = content.RequestPort,
                PeerIPAddress = content.RequestIpAddress,
                ReceiverId    = content.RemoteInfo.Id
            };

            using (var client = ClientModel.Get())
                sendingContent.RemoteInfo = new UserDto(client.Chat.User);

            ClientModel.Client.SendMessage(ServerP2PReadyAcceptCommand.CommandId, sendingContent);

            ClientModel.Logger.WriteDebug("ClientWaitPeerConnectionCommand: {0}|{1}|{2}|{3}"
                                          , new IPAddress(sendingContent.PeerIPAddress)
                                          , sendingContent.PeerPort
                                          , sendingContent.ReceiverId
                                          , sendingContent.RemoteInfo.Id
                                          );
        }