Class: Thrift::IOStreamTransport
- Inherits:
-
BaseTransport
- Object
- BaseTransport
- Thrift::IOStreamTransport
- Defined in:
- lib/thrift/transport/io_stream_transport.rb
Instance Method Summary collapse
- #close ⇒ Object
-
#initialize(input, output) ⇒ IOStreamTransport
constructor
A new instance of IOStreamTransport.
- #open? ⇒ Boolean
- #read(sz) ⇒ Object
-
#to_io ⇒ Object
we’re assuming this is used in a IO.select for reading.
- #write(buf) ⇒ Object
Methods inherited from BaseTransport
Constructor Details
#initialize(input, output) ⇒ IOStreamTransport
Returns a new instance of IOStreamTransport.
28 29 30 31 |
# File 'lib/thrift/transport/io_stream_transport.rb', line 28 def initialize(input, output) @input = input @output = output end |
Instance Method Details
#close ⇒ Object
36 |
# File 'lib/thrift/transport/io_stream_transport.rb', line 36 def close; @input.close; @output.close end |
#open? ⇒ Boolean
33 |
# File 'lib/thrift/transport/io_stream_transport.rb', line 33 def open?; not @input.closed? or not @output.closed? end |
#read(sz) ⇒ Object
34 |
# File 'lib/thrift/transport/io_stream_transport.rb', line 34 def read(sz); @input.read(sz) end |
#to_io ⇒ Object
we’re assuming this is used in a IO.select for reading
37 |
# File 'lib/thrift/transport/io_stream_transport.rb', line 37 def to_io; @input end |
#write(buf) ⇒ Object
35 |
# File 'lib/thrift/transport/io_stream_transport.rb', line 35 def write(buf); @output.write(buf) end |