/// <summary> /// Constructor. /// </summary> /// <param name="mode">The mode which indicate this connection if reliable or lossy.</param> /// <param name="remoteEp">The remote endpoint.</param> /// <param name="autoHandle">Decide if receiver will auto handle incoming packets.</param> /// <param name="sender">Sender Used to send packet</param> public RdpeudpSocket(TransportMode mode, IPEndPoint remoteEp, bool autohandle, RdpeudpSocketSender sender) { this.TransMode = mode; this.SocketConfig = new RdpeudpSocketConfig(); this.AutoHandle = autohandle; this.connected = false; remoteEndPoint = remoteEp; // Initial highestAckNumber as 0 because every hihestAckNumber will compare with Sequence Number of coming packet, and set as the bigger one. SnSourceAck = 0; URemoteAdvisedWindowSize = SocketConfig.initialWindowSize; USendWindowSize = SocketConfig.initialWindowSize; UReceiveWindowSize = SocketConfig.initialWindowSize; UUpStreamMtu = SocketConfig.initialStreamMtu; UDownStreamMtu = SocketConfig.initialStreamMtu; OutSnAckOfAcksSeqNum = SocketConfig.initialAcksPosition; InSnAckOfAcksSeqNum = SocketConfig.initialAcksPosition; ReceiveWindowStartPosition = SocketConfig.initialAcksPosition; RTT = new TimeSpan(0, 0, 0, 0, this.SocketConfig.DelayAckTime); packetSender = sender; }
/// <summary> /// Constructor. /// </summary> /// <param name="mode">Reliable or Lossy.</param> /// <param name="remoteEp">Remote endpoint.</param> /// <param name="autoHandle">Auto Handle or not.</param> /// <param name="sender">Sender Used to send packet</param> /// <param name="rdpeudpServer">RDPEUDP Server</param> public RdpeudpServerSocket(TransportMode mode, IPEndPoint remoteEp, bool autohandle, RdpeudpSocketSender sender, RdpeudpServer rdpeudpServer) : base(mode, remoteEp, autohandle, sender) { this.rdpeudpServer = rdpeudpServer; }
/// <summary> /// Constructor. /// </summary> /// <param name="mode">Reliable or Lossy.</param> /// <param name="remoteEp">Remote endpoint.</param> /// <param name="autoHandle">Auto Handle or not.</param> /// <param name="sender">Sender Used to send packet</param> public RdpeudpClientSocket(TransportMode mode, IPEndPoint remoteEp, bool autohandle, RdpeudpSocketSender sender) : base(mode, remoteEp, autohandle, sender) { }
/// <summary> /// Initialize a new RdpeudpClientSocket instance. /// </summary> /// <param name="mode">Reliable or Lossy.</param> /// <param name="remoteEp">Remote endpoint.</param> /// <param name="autoHandle">Auto Handle or not.</param> /// <param name="sender">Sender Used to send packet</param> /// <param name="cookieHash">the SHA-256 hash of the data that was transmitted from the server to the client in the securityCookie field of the Initiate Multitransport Request PDU.</param> public RdpeudpClientSocket(TransportMode mode, IPEndPoint remoteEp, bool autoHandle, RdpeudpSocketSender sender, byte[] cookieHash) : base(mode, remoteEp, autoHandle, sender) { this.cookieHash = cookieHash; }
/// <summary> /// Constructor. /// </summary> /// <param name="mode">Reliable or Lossy.</param> /// <param name="remoteEp">Remote endpoint.</param> /// <param name="autoHandle">Auto Handle or not.</param> /// <param name="sender">Sender Used to send packet</param> /// <param name="rdpeudpServer">RDPEUDP Server</param> public RdpeudpServerSocket(TransportMode mode, IPEndPoint remoteEp, bool autohandle, RdpeudpSocketSender sender, RdpeudpServer rdpeudpServer) : base(mode, remoteEp, autohandle, sender) { this.rdpeudpServer = rdpeudpServer; }
/// <summary> /// Constructor. /// </summary> /// <param name="mode">The mode which indicate this connection if reliable or lossy.</param> /// <param name="remoteEp">The remote endpoint.</param> /// <param name="autoHandle">Decide if receiver will auto handle incoming packets.</param> /// <param name="sender">Sender Used to send packet</param> public RdpeudpSocket(TransportMode mode, IPEndPoint remoteEp, bool autohandle, RdpeudpSocketSender sender) { this.TransMode = mode; this.SocketConfig = new RdpeudpSocketConfig(); this.AutoHandle = autohandle; this.connected = false; remoteEndPoint = remoteEp; // Initial highestAckNumber as 0 because every hihestAckNumber will compare with Sequence Number of coming packet, and set as the bigger one. SnSourceAck = 0; URemoteAdvisedWindowSize = SocketConfig.initialWindowSize; USendWindowSize = SocketConfig.initialWindowSize; UReceiveWindowSize = SocketConfig.initialWindowSize; UUpStreamMtu = SocketConfig.initialStreamMtu; UDownStreamMtu = SocketConfig.initialStreamMtu; OutSnAckOfAcksSeqNum = SocketConfig.initialAcksPosition; InSnAckOfAcksSeqNum = SocketConfig.initialAcksPosition; ReceiveWindowStartPosition = SocketConfig.initialAcksPosition; RTT = new TimeSpan(0, 0, 0, 0, this.SocketConfig.DelayAckTime); packetSender = sender; }
/// <summary> /// Constructor. /// </summary> /// <param name="mode">Reliable or Lossy.</param> /// <param name="remoteEp">Remote endpoint.</param> /// <param name="autoHandle">Auto Handle or not.</param> /// <param name="sender">Sender Used to send packet</param> public RdpeudpClientSocket(TransportMode mode, IPEndPoint remoteEp, bool autohandle, RdpeudpSocketSender sender) : base(mode, remoteEp, autohandle, sender) { }