Class: ThriftHelpers::Connection::Socket

Inherits:
Base
  • Object
show all
Defined in:
lib/thrift_client/connection/socket.rb

Instance Attribute Summary

Attributes inherited from Base

#server, #transport

Instance Method Summary collapse

Methods inherited from Base

#open?

Constructor Details

#initialize(*args) ⇒ Socket

Returns a new instance of Socket.



4
5
6
7
8
9
10
# File 'lib/thrift_client/connection/socket.rb', line 4

def initialize(*args)
  super *args

  host, port = parse_server(@server)
  @transport = @transport.new(host, port.to_i, @timeout)
  @transport = @transport_wrapper.new(@transport) if @transport_wrapper
end

Instance Method Details

#closeObject



12
13
14
# File 'lib/thrift_client/connection/socket.rb', line 12

def close
  @transport.close
end

#connect!Object



16
17
18
# File 'lib/thrift_client/connection/socket.rb', line 16

def connect!
  @transport.open
end