Class: QuartzTorrent::UdpTrackerRequest

Inherits:
Object
  • Object
show all
Defined in:
lib/quartz_torrent/udptrackermsg.rb

Overview

Superclass for UDP tracker requests.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeUdpTrackerRequest

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

#actionObject

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

#connectionIdObject

Get the connectionId as an integer



63
64
65
# File 'lib/quartz_torrent/udptrackermsg.rb', line 63

def connectionId
  @connectionId
end

#transactionIdObject

Get the transactionId as an integer.



67
68
69
# File 'lib/quartz_torrent/udptrackermsg.rb', line 67

def transactionId
  @transactionId
end