Method: Dalli::Socket::TCP.open

Defined in:
lib/dalli/socket.rb

.open(host, port, options = {}) ⇒ Object



91
92
93
94
95
96
97
98
# File 'lib/dalli/socket.rb', line 91

def self.open(host, port, options = {})
  create_socket_with_timeout(host, port, options) do |sock|
    sock.options = { host: host, port: port }.merge(options)
    init_socket_options(sock, options)

    options[:ssl_context] ? wrapping_ssl_socket(sock, host, options[:ssl_context]) : sock
  end
end