Sha256: 000629c3924a9b7b3275d3b22451f90b6007a4a82fa97bb88475051cb1c502ad

Contents?: true

Size: 646 Bytes

Versions: 13

Compression:

Stored size: 646 Bytes

Contents

module ThriftHelpers
  module Connection
    class Socket < Base
      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

      def close
        @transport.close
      end

      def connect!
        @transport.open
      end

      private

      def parse_server(server)
        host, port = server.to_s.split(":")
        raise ArgumentError, 'Servers must be in the form "host:port"' unless host and port
        [host, port]
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 5 rubygems

Version Path
thrift_client-0.11.0 lib/thrift_client/connection/socket.rb
thrift_client-0.10.0 lib/thrift_client/connection/socket.rb
rt_thrift_client-0.11.0 lib/thrift_client/connection/socket.rb
RaymondChou-thrift_client-0.9.3 lib/thrift_client/connection/socket.rb
thrift_client-adamd-0.9.4 lib/thrift_client/connection/socket.rb
thrift_client-adamd-0.9.3 lib/thrift_client/connection/socket.rb
thrift_client-0.9.3 lib/thrift_client/connection/socket.rb
thrift_client-mavericks-0.8.4 lib/thrift_client/connection/socket.rb
thrift_client-0.9.2 lib/thrift_client/connection/socket.rb
thrift_client-0.9.1 lib/thrift_client/connection/socket.rb
thrift_client-0.8.4 lib/thrift_client/connection/socket.rb
thrift_client-0.9.0 lib/thrift_client/connection/socket.rb
thrift_client-0.8.3 lib/thrift_client/connection/socket.rb