Module: Aerospike::Connection::Create

Defined in:
lib/aerospike/connection/create.rb

Class Method Summary collapse

Class Method Details

.call(host, port, timeout: 30, tls_name: nil, tls_options: nil) ⇒ Object



24
25
26
27
28
29
30
31
32
# File 'lib/aerospike/connection/create.rb', line 24

def call(host, port, timeout: 30, tls_name: nil, tls_options: nil)
  if !tls_options.nil? && tls_options[:enable] != false
    ::Aerospike::Socket::SSL.connect(
      host, port, timeout, tls_name, tls_options
    )
  else
    ::Aerospike::Socket::TCP.connect(host, port, timeout)
  end
end