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).

@since 2.0.0

# File lib/mongo/socket/unix.rb, line 38
def initialize(path, timeout, options = {})
  @path, @timeout, @options = path, timeout, options
  @socket = ::UNIXSocket.new(path)
  set_socket_options(@socket)
end

Private Instance Methods

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