Class: Moped::Sockets::TCP

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

Overview

This is a wrapper around a tcp socket.

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:

Since:

  • 1.2.0



17
18
19
20
# File 'lib/moped/sockets/tcp.rb', line 17

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