class Mongo::Socket::Unix

Wrapper for Unix sockets.

@since 2.0.0

Attributes

path[R]

@return [ String ] path The path to connect to.

Public Class Methods

new(path, timeout, options = {}) click to toggle source

Initializes a new Unix socket.

@example Create the Unix socket.

Unix.new('/path/to.sock', 5)

@param [ String ] path The path. @param [ Float ] timeout The socket timeout value. @param [ Hash ] options The options.

@option options [ Float ] :connect_timeout Connect timeout (unused). @option options [ Address ] :connection_address Address of the

connection that created this socket.

@option options [ Integer ] :connection_generation Generation of the

connection (for non-monitoring connections) that created this socket.

@option options [ true | false ] :monitor Whether this socket was

created by a monitoring connection.

@since 2.0.0 @api private

Calls superclass method Mongo::Socket::new
# File lib/mongo/socket/unix.rb, line 42
def initialize(path, timeout, options = {})
  super(timeout, options)
  @path = path
  @socket = ::UNIXSocket.new(path)
  set_socket_options(@socket)
end

Private Instance Methods

human_address() click to toggle source
# File lib/mongo/socket/unix.rb, line 54
def human_address
  path
end