Class: Mongo::Socket::Unix
- Inherits:
-
Mongo::Socket
- Object
- Mongo::Socket
- Mongo::Socket::Unix
- Defined in:
- lib/mongo/socket/unix.rb
Overview
Wrapper for Unix sockets.
Constant Summary
Constants inherited from Mongo::Socket
SSL_ERROR, TIMEOUT_ERROR, TIMEOUT_PACK
Instance Attribute Summary collapse
-
#path ⇒ String
readonly
Path The path to connect to.
-
#timeout ⇒ Float
readonly
Timeout The connection timeout.
Attributes inherited from Mongo::Socket
Instance Method Summary collapse
-
#connect! ⇒ Unix
Establishes a socket connection.
-
#initialize(path, timeout) ⇒ Unix
constructor
Initializes a new Unix socket.
Methods inherited from Mongo::Socket
#alive?, #close, #eof?, #gets, #read, #readbyte, #write
Constructor Details
#initialize(path, timeout) ⇒ Unix
Initializes a new Unix socket.
53 54 55 56 57 |
# File 'lib/mongo/socket/unix.rb', line 53 def initialize(path, timeout) @path, @timeout = path, timeout @socket = ::UNIXSocket.new(path) (@socket) end |
Instance Attribute Details
#path ⇒ String (readonly)
Returns path The path to connect to.
24 25 26 |
# File 'lib/mongo/socket/unix.rb', line 24 def path @path end |
#timeout ⇒ Float (readonly)
Returns timeout The connection timeout.
27 28 29 |
# File 'lib/mongo/socket/unix.rb', line 27 def timeout @timeout end |
Instance Method Details
#connect! ⇒ Unix
Note:
This method mutates the object by setting the socket internally.
Establishes a socket connection.
40 41 42 |
# File 'lib/mongo/socket/unix.rb', line 40 def connect! self end |