Class: Moped::Connection::Socket::TCP

Inherits:
TCPSocket
  • Object
show all
Includes:
Connectable
Defined in:
lib/moped/connection/socket/tcp.rb

Overview

This is a wrapper around a tcp socket.

Since:

  • 2.0.0

Instance Attribute Summary

Attributes included from Connectable

#host, #port

Instance Method Summary collapse

Methods included from Connectable

#alive?, included, #read, #write

Constructor Details

#initialize(host, port) ⇒ TCP

Initialize the new TCPSocket.

Examples:

Initialize the socket.

TCPSocket.new("127.0.0.1", 27017)

Parameters:

  • host (String)

    The host.

  • port (Integer)

    The port.

Since:

  • 1.2.0



18
19
20
21
# File 'lib/moped/connection/socket/tcp.rb', line 18

def initialize(host, port)
  @host, @port = host, port
  handle_socket_errors { super }
end