/// <summary>
        /// Constructor
        /// </summary>
        /// <param name="localEp"></param>
        public RdpeudpClient(IPEndPoint localEp, IPEndPoint remoteEp, TransportMode mode, bool autoHandle = true)
        {
            this.localEndPoint = localEp;
            this.remoteEndpoint = remoteEp;
            this.AutoHandle = autoHandle;
            this.transMode = mode;

            UdpClientConfig config = new UdpClientConfig(localEp.Port, remoteEp);
            udpTransport = new TransportStack(config, RdpeudpBasePacket.DecodePacketCallback);

            socket = new RdpeudpClientSocket(transMode, remoteEp, autoHandle, packetsender);
        }
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="localEp"></param>
        public RdpeudpClient(IPEndPoint localEp, IPEndPoint remoteEp, TransportMode mode, bool autoHandle = true)
        {
            this.localEndPoint  = localEp;
            this.remoteEndpoint = remoteEp;
            this.AutoHandle     = autoHandle;
            this.transMode      = mode;

            UdpClientConfig config = new UdpClientConfig(localEp.Port, remoteEp);

            udpTransport = new TransportStack(config, RdpeudpBasePacket.DecodePacketCallback);

            socket = new RdpeudpClientSocket(transMode, remoteEp, autoHandle, packetsender);
        }
        /// <summary>
        /// Initialize a new RdpeudpClient instance.
        /// </summary>
        /// <param name="localEp">Local endpoint.</param>
        /// <param name="remoteEp">Remote endpoint.</param>
        /// <param name="mode">Transport mode.</param>
        /// <param name="autoHandle">Auto handle transport.</param>
        /// <param name="securityCookie">The securityCookie field of the Initiate Multitransport Request PDU</param>
        public RdpeudpClient(IPEndPoint localEp, IPEndPoint remoteEp, TransportMode mode, bool autoHandle = true, byte[] securityCookie = null)
        {
            this.localEndPoint  = localEp;
            this.remoteEndPoint = remoteEp;
            this.AutoHandle     = autoHandle;
            this.transMode      = mode;

            UdpClientConfig config = new UdpClientConfig(localEp.Port, remoteEp);

            udpTransport = new TransportStack(config, RdpeudpBasePacket.DecodePacketCallback);

            if (securityCookie == null)
            {
                cookieHash = new byte[32];
            }
            else
            {
                cookieHash = SHA256.HashData(securityCookie);
            }

            socket = new RdpeudpClientSocket(transMode, remoteEp, autoHandle, PacketSender, cookieHash);
        }