public void Connect(PeerAddress peerAddress)
        {
            var connectAsServerMessage = new PeerAddressMessage(peerAddress, MessageType.ConnectAsClient);
            Peer.SendToSuperPeer(connectAsServerMessage);

            Peer.ReadFromSuperPeer();
            var connection = new TcpClientPeerConnection(this, Peer.PeerAddress);
            _server = connection.GetConnection();
            Peer.Close();
        }
Пример #2
0
        public void Connect(PeerAddress peerAddress)
        {
            var connectAsServerMessage = new PeerAddressMessage(peerAddress, MessageType.ConnectAsClient);

            Peer.SendToSuperPeer(connectAsServerMessage);

            Peer.ReadFromSuperPeer();
            var connection = new TcpClientPeerConnection(this, Peer.PeerAddress);

            _server = connection.GetConnection();
            Peer.Close();
        }