Method: Moped::Connection#connect

Defined in:
lib/moped/connection.rb

#connect(host, port, timeout) ⇒ TCPSocket

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Connect to the server.

Examples:

Connect to the server.

connection.connect("127.0.0.1", 27017, 30)

Parameters:

  • host (String)

    The host to connect to.

  • post (Integer)

    The server port.

  • timeout (Integer)

    The connection timeout.

Returns:

Since:

  • 1.0.0



34
35
36
# File 'lib/moped/connection.rb', line 34

def connect(host, port, timeout)
  @sock = TCPSocket.connect host, port, timeout
end