private void AddSuperPeerNodeToConnectionsRepository(ClientType clientType, SuperPeerNode superPeerNode)
 {
     if (clientType == ClientType.Client)
         ConnectionsRepository.AddClient((SuperPeerClient) superPeerNode);
     else
         ConnectionsRepository.AddServer((SuperPeerServer) superPeerNode);
 }
Esempio n. 2
0
        public void BeginProcessClientConnection()
        {
            if (!InitClientConnection())
            {
                return;
            }

            if (!InitPeerType())
            {
                return;
            }

            if (!InitClientAddress())
            {
                return;
            }

            InitClientInfo();

            ClientRepository.AddClient(_client, _clientInfo);

            SuperPeerNode superPeerNode = GetSuperPeerNodeByClientType(_clientInfo.ClientType());

            AddSuperPeerNodeToConnectionsRepository(_clientInfo.ClientType(), superPeerNode);

            _client.Send(new ConfirmationMessage(MessageType.Connection));

            PeerMessageManager peerMessageManager = new PeerMessageManager(superPeerNode);

            peerMessageManager.BeginProcessClientMessages();
        }
Esempio n. 3
0
 private void AddSuperPeerNodeToConnectionsRepository(ClientType clientType, SuperPeerNode superPeerNode)
 {
     if (clientType == ClientType.Client)
     {
         ConnectionsRepository.AddClient((SuperPeerClient)superPeerNode);
     }
     else
     {
         ConnectionsRepository.AddServer((SuperPeerServer)superPeerNode);
     }
 }
 public PeerMessageManager(SuperPeerNode superPeerNode)
 {
     _superPeerNode = superPeerNode;
 }
 public PeerMessageManager(SuperPeerNode superPeerNode)
 {
     _superPeerNode = superPeerNode;
 }
Esempio n. 6
0
 private void StartListeningMessagesFromSuperPeerNode(SuperPeerNode superPeerNode)
 {
     superPeerNode.GetClientInfo().Client.ListenMessages();
 }
Esempio n. 7
0
 private void StartListeningMessagesFromSuperPeerNode(SuperPeerNode superPeerNode)
 {
     superPeerNode.GetClientInfo().Client.ListenMessages();
 }