Class Mongo::Socket::TCP
In: lib/mongo/socket/tcp.rb
Parent: Socket

Wrapper for TCP sockets.

@since 2.0.0

Methods

new  

Attributes

host  [R]  @return [ String ] host The host to connect to.
port  [R]  @return [ Integer ] port The port to connect to.
timeout  [R]  @return [ Float ] timeout The socket timeout.

Public Class methods

Initializes a new TCP socket.

@example Create the TCP socket.

  TCP.new('::1', 27017, 30, Socket::PF_INET)
  TCP.new('127.0.0.1', 27017, 30, Socket::PF_INET)

@param [ String ] host The hostname or IP address. @param [ Integer ] port The port number. @param [ Float ] timeout The socket timeout value. @param [ Integer ] family The socket family. @param [ Hash ] options The options.

@option options [ Float ] :connect_timeout Connect timeout.

@since 2.0.0

[Validate]