Class: Scriptroute::TimedPacket
- Inherits:
-
Object
- Object
- Scriptroute::TimedPacket
- Defined in:
- lib/scriptroute.rb
Overview
TimedPacket is a time, packet tuple, with a tsc value thrown in in case its useful
Instance Attribute Summary collapse
- #packet ⇒ IP
- #time ⇒ Float?
-
#tsc ⇒ Fixnum?
The output of rdtsc can be a more useful value in calculating rtt when NTP’s adjustments via skew cause trouble.
Instance Method Summary collapse
-
#initialize(time, tsc, packet) ⇒ TimedPacket
constructor
A new instance of TimedPacket.
Constructor Details
#initialize(time, tsc, packet) ⇒ TimedPacket
Returns a new instance of TimedPacket.
114 115 116 117 118 119 120 |
# File 'lib/scriptroute.rb', line 114 def initialize(time, tsc, packet) raise ArgumentError, "no packet" unless packet raise ArgumentError, "packet of the wrong class" unless packet.is_a?(IP) @time = time @tsc = tsc @packet = packet end |
Instance Attribute Details
#time ⇒ Float?
103 104 105 |
# File 'lib/scriptroute.rb', line 103 def time @time end |
#tsc ⇒ Fixnum?
Returns The output of rdtsc can be a more useful value in calculating rtt when NTP’s adjustments via skew cause trouble.
107 108 109 |
# File 'lib/scriptroute.rb', line 107 def tsc @tsc end |