Class: QuartzTorrent::IOInfo

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

Overview

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(io, metainfo, seekable = false) ⇒ IOInfo

Create a new IOInfo object that operates on the passed IO object.

Parameters:

  • io

    An IO object

  • metainfo

    The metainfo to associate with the IO.

  • seekable (defaults to: false)

    Whether the IO is seekable or not.



336
337
338
339
340
341
342
343
344
345
346
347
348
349
# 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

Instance Attribute Details

#connectTimeoutObject

Returns the value of attribute connectTimeout.



354
355
356
# File 'lib/quartz_torrent/reactor.rb', line 354

def connectTimeout
  @connectTimeout
end

#connectTimerObject

Returns the value of attribute connectTimer.



358
359
360
# File 'lib/quartz_torrent/reactor.rb', line 358

def connectTimer
  @connectTimer
end

#ioObject

Returns the value of attribute io.



350
351
352
# File 'lib/quartz_torrent/reactor.rb', line 350

def io
  @io
end

#lastReadErrorObject

Returns the value of attribute lastReadError.



353
354
355
# File 'lib/quartz_torrent/reactor.rb', line 353

def lastReadError
  @lastReadError
end

#metainfoObject

Returns the value of attribute metainfo.



351
352
353
# File 'lib/quartz_torrent/reactor.rb', line 351

def metainfo
  @metainfo
end

#outputBufferObject

Returns the value of attribute outputBuffer.



355
356
357
# File 'lib/quartz_torrent/reactor.rb', line 355

def outputBuffer
  @outputBuffer
end

#readFiberObject

Returns the value of attribute readFiber.



356
357
358
# File 'lib/quartz_torrent/reactor.rb', line 356

def readFiber
  @readFiber
end

#readFiberIoFacadeObject

Returns the value of attribute readFiberIoFacade.



357
358
359
# File 'lib/quartz_torrent/reactor.rb', line 357

def readFiberIoFacade
  @readFiberIoFacade
end

#readRateLimitObject

Returns the value of attribute readRateLimit.



360
361
362
# File 'lib/quartz_torrent/reactor.rb', line 360

def readRateLimit
  @readRateLimit
end

#stateObject

Returns the value of attribute state.



352
353
354
# File 'lib/quartz_torrent/reactor.rb', line 352

def state
  @state
end

#useErrorhandlerObject

Returns the value of attribute useErrorhandler.



359
360
361
# File 'lib/quartz_torrent/reactor.rb', line 359

def useErrorhandler
  @useErrorhandler
end

#writeRateLimitObject

Returns the value of attribute writeRateLimit.



361
362
363
# File 'lib/quartz_torrent/reactor.rb', line 361

def writeRateLimit
  @writeRateLimit
end

Instance Method Details

#seekable?Boolean

Is the IO seekable.

Returns:

  • (Boolean)


364
365
366
# File 'lib/quartz_torrent/reactor.rb', line 364

def seekable?
  @seekable
end