class QuartzTorrent::Cancel

Cancel message. Cancel an outstanding request.

Attributes

blockLength[RW]
blockOffset[RW]
pieceIndex[RW]

Public Class Methods

new() click to toggle source
Calls superclass method QuartzTorrent::PeerWireMessage::new
# File lib/quartz_torrent/peermsg.rb, line 303
def initialize
  super(MessageCancel)
end

Public Instance Methods

payloadLength() click to toggle source
# File lib/quartz_torrent/peermsg.rb, line 311
def payloadLength
  12
end
serializeTo(io) click to toggle source
# File lib/quartz_torrent/peermsg.rb, line 315
def serializeTo(io)
  super(io)
  io.write [@pieceIndex, @blockOffset, @blockLength].pack("NNN")
end
to_s() click to toggle source
Calls superclass method QuartzTorrent::PeerWireMessage#to_s
# File lib/quartz_torrent/peermsg.rb, line 324
def to_s
  s = super
  s + ": piece index=#{@pieceIndex}, block offset=#{@blockOffset}, block length=#{@blockLength}"
end
unserialize(payload) click to toggle source
# File lib/quartz_torrent/peermsg.rb, line 320
def unserialize(payload)
  @pieceIndex, @blockOffset, @blockLength = payload.unpack("NNN")
end