Method: Moped::Connection::Socket::SSL#initialize

Defined in:
lib/moped/connection/socket/ssl.rb

#initialize(host, port) ⇒ SSL

Initialize the new TCPSocket with SSL.

Examples:

Initialize the socket.

SSL.new("127.0.0.1", 27017)

Parameters:

  • host (String)

    The host.

  • port (Integer)

    The port.

Since:

  • 1.2.0



22
23
24
25
26
27
28
29
30
# File 'lib/moped/connection/socket/ssl.rb', line 22

def initialize(host, port)
  @host, @port = host, port
  handle_socket_errors do
    @socket = TCPSocket.new(host, port)
    super(socket)
    self.sync_close = true
    connect
  end
end