Class: QuartzTorrent::UdpTrackerRequest
- Inherits:
-
Object
- Object
- QuartzTorrent::UdpTrackerRequest
- Defined in:
- lib/quartz_torrent/udptrackermsg.rb
Overview
Superclass for UDP tracker requests.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#action ⇒ Object
Get the action as an integer.
-
#connectionId ⇒ Object
Get the connectionId as an integer.
-
#transactionId ⇒ Object
Get the transactionId as an integer.
Instance Method Summary collapse
-
#initialize ⇒ UdpTrackerRequest
constructor
A new instance of UdpTrackerRequest.
Constructor Details
#initialize ⇒ UdpTrackerRequest
Returns a new instance of UdpTrackerRequest.
55 56 57 58 59 60 |
# File 'lib/quartz_torrent/udptrackermsg.rb', line 55 def initialize @connectionId = 0x41727101980 @action = UdpTrackerMessage::ActionConnect # Get a number that is a valid 32-bit signed integer. @transactionId = rand(0x10000000)-8000000 end |
Instance Attribute Details
#action ⇒ Object
Get the action as an integer. Should be one of the UdpTrackerMessage::Action* constants
65 66 67 |
# File 'lib/quartz_torrent/udptrackermsg.rb', line 65 def action @action end |
#connectionId ⇒ Object
Get the connectionId as an integer
63 64 65 |
# File 'lib/quartz_torrent/udptrackermsg.rb', line 63 def connectionId @connectionId end |
#transactionId ⇒ Object
Get the transactionId as an integer.
67 68 69 |
# File 'lib/quartz_torrent/udptrackermsg.rb', line 67 def transactionId @transactionId end |