/* ------------------------------- Private Methods -------------------------------------- */ /// <summary> Init this object /// /// </summary> /// <param name="sender">the address from which retransmissions are expected /// </param> /// <param name="cmd">the retransmission callback reference /// </param> /// <param name="sched">retransmissions scheduler /// </param> /// <param name="sched_owned">whether the scheduler parameter is owned by this /// object or is externally provided /// </param> private void init(Address sender, Retransmitter.RetransmitCommand cmd, TimeScheduler sched, bool sched_owned) { this.sender = sender; this.cmd = cmd; retransmitter_owned = sched_owned; retransmitter = sched; }
/// <summary> /// Constructor: Creates a new instance with the given retransmit command /// </summary> /// <param name="sender">The sender associated with this instance</param> /// <param name="cmd">The command used to retransmit a missing message</param> /// <param name="start_seqno">The first sequence number to be received</param> /// <param name="sched">The external scheduler to use for retransmission</param> public NakReceiverWindow(Address sender, Retransmitter.RetransmitCommand cmd, long start_seqno, TimeScheduler sched) { this.sender = sender; this.cmd = cmd; head = start_seqno; tail = head; if (cmd != null) retransmitter = sched==null ? new Retransmitter(sender, cmd): new Retransmitter(sender, cmd, sched); }
/// <summary> /// Constructor: Creates a new instance with the given retransmit command /// </summary> /// <param name="sender">The sender associated with this instance</param> /// <param name="cmd">The command used to retransmit a missing message</param> /// <param name="start_seqno">The first sequence number to be received</param> /// <param name="sched">The external scheduler to use for retransmission</param> public NakReceiverWindow(Address sender, Retransmitter.RetransmitCommand cmd, long start_seqno, TimeScheduler sched) { this.sender = sender; this.cmd = cmd; head = start_seqno; tail = head; if (cmd != null) { retransmitter = sched == null ? new Retransmitter(sender, cmd): new Retransmitter(sender, cmd, sched); } }
/// <summary> Create a new Retransmitter associated with the given sender address</summary> /// <param name="sender">the address from which retransmissions are expected or to which retransmissions are sent /// </param> /// <param name="cmd">the retransmission callback reference /// </param> public Retransmitter(Address sender, Retransmitter.RetransmitCommand cmd) { init(sender, cmd, new TimeScheduler(30 * 1000), true); }
/// <summary> Create a new Retransmitter associated with the given sender address</summary> /// <param name="sender">the address from which retransmissions are expected or to which retransmissions are sent /// </param> /// <param name="cmd">the retransmission callback reference /// </param> /// <param name="sched">retransmissions scheduler /// </param> public Retransmitter(Address sender, Retransmitter.RetransmitCommand cmd, TimeScheduler sched) { init(sender, cmd, sched, false); }
/// <summary> /// Constructor: Creates a new instance with the given retransmit command /// </summary> /// <param name="sender">The sender associated with this instance</param> /// <param name="cmd">The command used to retransmit a missing message</param> /// <param name="start_seqno">The first sequence number to be received</param> public NakReceiverWindow(Address sender, Retransmitter.RetransmitCommand cmd, long start_seqno) : this(sender, cmd, start_seqno, null) { }