/// <summary>
        /// Constructor
        /// </summary>
        /// <param name="socket"></param>
        /// <param name="targetHost"></param>
        /// <param name="autoHandle"></param>
        public RdpemtClient(RdpeudpSocket socket, string targetHost, bool autoHandle = true)
            : base(autoHandle)
        {
            if (!socket.AutoHandle)
            {
                throw new NotSupportedException("To Create RDPEMT Server, RDPEUDP Socket must be auto handle.");
            }

            if (socket.TransMode == TransportMode.Reliable)
            {
                RdpeudpTLSChannel secChannel = new RdpeudpTLSChannel(socket);
                secChannel.Received += ReceiveBytes;
                secChannel.AuthenticateAsClient(targetHost);
                this.secureChannel = secChannel;
            }
            else
            {
                RdpeudpDTLSChannel secChannel = new RdpeudpDTLSChannel(socket);
                secChannel.Received += ReceiveBytes;
                secChannel.AuthenticateAsClient(targetHost);
                this.secureChannel = secChannel;
            }

            bandwidthMeasureStartTime        = DateTime.Now;
            bandwidthMeasurePayloadByteCount = 0;
            detectBandwidth = false;
        }
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="socket"></param>
        /// <param name="targetHost"></param>
        /// <param name="autoHandle"></param>
        public RdpemtClient(RdpeudpSocket socket, string targetHost, bool autoHandle = true)
            : base(autoHandle)
        {
            if (!socket.AutoHandle)
            {
                throw new NotSupportedException("To Create RDPEMT Server, RDPEUDP Socket must be auto handle.");
            }

            if (socket.TransMode == TransportMode.Reliable)
            {
                RdpeudpTLSChannel secChannel = new RdpeudpTLSChannel(socket);
                secChannel.Received += ReceiveBytes;
                secChannel.AuthenticateAsClient(targetHost);
                this.secureChannel = secChannel;
            }
            else
            {
                RdpeudpDTLSChannel secChannel = new RdpeudpDTLSChannel(socket);
                secChannel.Received += ReceiveBytes;
                secChannel.AuthenticateAsClient(targetHost);
                this.secureChannel = secChannel;
            }

            bandwidthMeasureStartTime = DateTime.Now;
            bandwidthMeasurePayloadByteCount = 0;
            detectBandwidth = false;
        }
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="socket"></param>
        /// <param name="targetHost"></param>
        /// <param name="autoHandle"></param>
        /// <param name="selectedSslProtocols">The selected SSL protocols.</param>
        public RdpemtClient(RdpeudpSocket socket, string targetHost, bool autoHandle = true, SslProtocols selectedSslProtocols = SslProtocols.Tls)
            : base(autoHandle)
        {
            if (!socket.AutoHandle)
            {
                throw new NotSupportedException("To Create RDPEMT Server, RDPEUDP Socket must be auto handle.");
            }

            if (socket.TransMode == TransportMode.Reliable)
            {
                RdpeudpTLSChannel secChannel = new RdpeudpTLSChannel(socket);
                secChannel.Received += ReceiveBytes;
                secChannel.AuthenticateAsClient(targetHost, selectedSslProtocols);
                this.secureChannel = secChannel;
            }
            else
            {
                RdpeudpDTLSChannel secChannel = new RdpeudpDTLSChannel(socket);
                secChannel.Received += ReceiveBytes;
                secChannel.AuthenticateAsClient(targetHost);
                this.secureChannel = secChannel;
            }

            Initialize();
        }