Class: Thrift::IOStreamTransport
Instance Method Summary
collapse
#flush, #open, #read_all, #read_byte, #read_into_buffer, #set_context
Constructor Details
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(Bytes.force_binary_encoding(buf)) end
|