Ejemplo n.º 1
0
        public void AllowConnection(PeerAddress peerAddress)
        {
            var connectAsServerMessage = new PeerAddressMessage(peerAddress, MessageType.ConnectAsServer);
            Peer.SendToSuperPeer(connectAsServerMessage);

            Peer.ReadFromSuperPeer();
            ServerPeerConnection serverPeerConnection = new TcpServerPeerConnection(this);
            _client = serverPeerConnection.GetConnection();

            Peer.Close();
            Console.WriteLine("Client connected to server");
        }
Ejemplo n.º 2
0
        public void AllowConnection(PeerAddress peerAddress)
        {
            var connectAsServerMessage = new PeerAddressMessage(peerAddress, MessageType.ConnectAsServer);

            Peer.SendToSuperPeer(connectAsServerMessage);

            Peer.ReadFromSuperPeer();
            ServerPeerConnection serverPeerConnection = new TcpServerPeerConnection(this);

            _client = serverPeerConnection.GetConnection();

            Peer.Close();
            Console.WriteLine("Client connected to server");
        }