Esempio n. 1
0
        internal SecureTcpConnection(RSAPair rsaPair, TcpClient tcpClient)
            : base(tcpClient, skipInitializationProcess: true)
        {
            //Setup the RSAConnectionHelper object.
            RSAConnection        = new RSAConnection(this, rsaPair);
            PacketConverter      = base.PacketConverter;
            base.PacketConverter = RSAConnection;

            //Since we did skip the initialization,... DO IT!
            Init();
        }
Esempio n. 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SecureUdpConnection"/> class.
        /// </summary>
        /// <param name="udpClient">The <see cref="UdpClient"/> to use for sending and receiving data.</param>
        /// <param name="remoteEndPoint">The remote end point to connect to.</param>
        /// <param name="rsaPair">The local RSA key-pair.</param>
        /// <param name="writeLock">Whether the connection has a write lock.</param>
        internal SecureUdpConnection(UdpClient udpClient, IPEndPoint remoteEndPoint, RSAPair rsaPair, bool writeLock = false)
            : base(udpClient, remoteEndPoint, writeLock, skipInitializationProcess: true)
        {
            //Setup the RSAConnectionHelper object.
            RSAConnection        = new RSAConnection(this, rsaPair);
            PacketConverter      = base.PacketConverter;
            base.PacketConverter = RSAConnection;

            //Since we did skip the initialization,... DO IT!
            Init();
        }