class QuartzTorrent::IOInfo

An IO and associated meta-information used by the Reactor. This is not part of the public API.

Attributes

connectTimeout[RW]
connectTimer[RW]
io[RW]
lastReadError[RW]
metainfo[RW]
outputBuffer[RW]
readFiber[RW]
readFiberIoFacade[RW]
readRateLimit[RW]
state[RW]
useErrorhandler[RW]
writeRateLimit[RW]

Public Class Methods

new(io, metainfo, seekable = false) click to toggle source

Create a new IOInfo object that operates on the passed IO object. @param io An IO object @param metainfo The metainfo to associate with the IO. @param seekable Whether the IO is seekable or not.

# File lib/quartz_torrent/reactor.rb, line 336
def initialize(io, metainfo, seekable = false)
  @io = io
  @metainfo = metainfo
  @readFiber = nil
  @readFiberIoFacade = IoFacade.new(self)
  @lastReadError = nil
  @connectTimer = nil
  @seekable = seekable
  @outputBuffer = OutputBuffer.new(@io, seekable)
  @useErrorhandler = true
  @readRateLimit = nil
  @writeRateLimit = nil
  raise "IO passed to IOInfo initialize may not be nil" if io.nil?
end

Public Instance Methods

seekable?() click to toggle source

Is the IO seekable.

# File lib/quartz_torrent/reactor.rb, line 364
def seekable?
  @seekable
end