/// <summary> /// Allows the intervals between retransmission to be specified. /// </summary> /// <param name="com"> /// If not null, its method <code>retransmit()</code> will be called when a message /// needs to be retransmitted (called by the Retransmitter). /// </param> /// <param name="interval">Array of intervals between retransmissions</param> public AckSenderWindow(RetransmitCommand com, long[] interval) { retransmitter = new Retransmitter(null, this); retransmit_command = com; this.interval = interval; retransmitter.setRetransmitTimeouts(interval); }
/* ------------------------------- Private Methods -------------------------------------- */ /// <summary> /// Initialises 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">Schedular for retransmit tasks</param> /// <param name="sched_owned">sched_owned whether the scheduler parameter is owned by this object or is externally provided</param> private void init(Address sender, RetransmitCommand cmd, TimeScheduler sched, bool sched_owned) { this.sender = sender; this.cmd = cmd; retransmitter_owned = sched_owned; retransmitter = sched; }
/// <summary> /// Allows the intervals between retransmission to be specified. /// </summary> /// <param name="com"> /// If not null, its method <code>retransmit()</code> will be called when a message /// needs to be retransmitted (called by the Retransmitter). /// </param> /// <param name="interval">Array of intervals between retransmissions</param> public AckSenderWindow(RetransmitCommand com, long[] interval) { retransmitter=new Retransmitter(null, this); retransmit_command=com; this.interval=interval; retransmitter.setRetransmitTimeouts(interval); }
/// <summary> Creates a new instance. Thre retransmission thread has to be started separately with /// <code>start()</code>. /// </summary> /// <param name="com">If not null, its method <code>retransmit()</code> will be called when a message /// needs to be retransmitted (called by the Retransmitter). /// </param> public AckSenderWindow(RetransmitCommand com, ILogger NCacheLog) { _ncacheLog = NCacheLog; InitBlock(); retransmit_command = com; retransmitter.RetransmitTimeouts = interval; }
/// <summary> This constructor whould be used when we want AckSenderWindow to send the message added /// by add(), rather then ourselves. /// </summary> public AckSenderWindow(RetransmitCommand com, long[] interval, Protocol transport, ILogger NCacheLog) { _ncacheLog = NCacheLog; InitBlock(); retransmit_command = com; this.interval = interval; this.transport = transport; retransmitter.RetransmitTimeouts = interval; }
public AckSenderWindow(RetransmitCommand com, long[] interval, ILogger NCacheLog) { //this.nTrace = nTrace; _ncacheLog = NCacheLog; InitBlock(); retransmit_command = com; this.interval = interval; retransmitter.RetransmitTimeouts = interval; }
/// <summary> /// Constructor /// </summary> /// <param name="low">Lowest sequence number in the Entry</param> /// <param name="high">Highest sequence number in the Entry</param> /// <param name="intervals">Time intervals between retransmission</param> /// <param name="initialSender">Sender of the messages</param> /// <param name="retCmd">Method to call when retransmitting</param> public Entry(long low, long high, long[] intervals, Address initialSender, RetransmitCommand retCmd) : base(intervals) { this.low = low; this.high = high; this.initialSender = initialSender; this.retCmd = retCmd; list = new ArrayList(); list.Add(new long[] { low, high }); }
/// <summary> Setup this object's state /// /// </summary> /// <param name="cmd">the callback object for retranmissions /// </param> /// <param name="retransmit_timeout">the interval between two consecutive /// retransmission attempts /// </param> /// <param name="sched">the external scheduler to use to schedule retransmissions /// </param> /// <param name="sched_owned">if true, the scheduler is owned by this object and /// can be started/stopped/destroyed. If false, the scheduler is shared /// among multiple objects and start()/stop() should not be called from /// within this object /// /// </param> /// <throws> IllegalArgumentException if <code>cmd</code> is null </throws> private void init(RetransmitCommand cmd, long[] retransmit_intervals, TimeScheduler sched, bool sched_owned) { if (cmd == null) { NCacheLog.Error("AckMcastSenderWindow.init", "command is null. Cannot retransmit " + "messages !"); throw new System.ArgumentException("Command is null."); } retransmitter_owned = sched_owned; retransmitter = sched; this.retransmit_intervals = retransmit_intervals; this.cmd = cmd; start(); }
/// <summary> /// Constructor: 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, RetransmitCommand cmd) { init(sender, cmd, new TimeScheduler(SUSPEND_TIMEOUT), true); }
/// <summary> /// Constructor: 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">The retransmissions scheduler</param> public Retransmitter(Address sender, RetransmitCommand cmd, TimeScheduler sched) { init(sender, cmd, sched, false); }
/// <summary> /// Constructor /// </summary> /// <param name="low">Lowest sequence number in the Entry</param> /// <param name="high">Highest sequence number in the Entry</param> /// <param name="intervals">Time intervals between retransmission</param> /// <param name="initialSender">Sender of the messages</param> /// <param name="retCmd">Method to call when retransmitting</param> public Entry(long low, long high, long[] intervals, Address initialSender, RetransmitCommand retCmd) : base(intervals) { this.low = low; this.high = high; this.initialSender = initialSender; this.retCmd = retCmd; list = new ArrayList(); list.Add(new long[]{low,high}); }
/// <summary> Create and <b>start</b> the retransmitter /// /// </summary> /// <param name="cmd">the callback object for retranmissions /// </param> /// <param name="sched">the external scheduler to use to schedule retransmissions /// /// </param> /// <throws> IllegalArgumentException if <code>cmd</code> is null </throws> public AckMcastSenderWindow(RetransmitCommand cmd, TimeScheduler sched, ILogger NCacheLog) { this._ncacheLog = NCacheLog; init(cmd, RETRANSMIT_TIMEOUTS, sched, false); }
/// <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, RetransmitCommand cmd) { init(sender, cmd, new TimeScheduler(30 * 1000), true); }
/// <summary> Create and <b>start</b> the retransmitter /// /// </summary> /// <param name="cmd">the callback object for retranmissions /// </param> /// <param name="retransmit_timeout">the interval between two consecutive /// retransmission attempts /// /// </param> /// <throws> IllegalArgumentException if <code>cmd</code> is null </throws> public AckMcastSenderWindow(RetransmitCommand cmd, long[] retransmit_intervals, ILogger NCacheLog) { this._ncacheLog = NCacheLog; init(cmd, retransmit_intervals, new TimeScheduler(SUSPEND_TIMEOUT), true); }