Sha256: 6702cc88c361a71c15e52a2d1290ecb3e5cdddde9a202de3445187d66d6050f8

Contents?: true

Size: 471 Bytes

Versions: 5

Compression:

Stored size: 471 Bytes

Contents

module Sip2
  #
  # Sip2 Client
  #
  class Client
    def initialize(host:, port:, ignore_error_detection: false)
      @host = host
      @port = port
      @ignore_error_detection = ignore_error_detection
    end

    def connect
      socket = NonBlockingSocket.connect @host, @port
      if block_given?
        connection = Connection.new(socket, @ignore_error_detection)
        yield connection
      end
    ensure
      socket.close if socket
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
sip2-0.0.5 lib/sip2/client.rb
sip2-0.0.4 lib/sip2/client.rb
sip2-0.0.3 lib/sip2/client.rb
sip2-0.0.2 lib/sip2/client.rb
sip2-0.0.1 lib/sip2/client.rb