Method: Mongo::Server::Monitor::Connection#initialize
- Defined in:
- lib/mongo/server/monitor/connection.rb
#initialize(address, options = {}) ⇒ Connection
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Note:
Monitoring connections do not authenticate.
Creates a new connection object to the specified target address with the specified options.
The constructor does not perform any I/O (and thus does not create sockets nor handshakes); call connect! method on the connection object to create the network connection.
58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/mongo/server/monitor/connection.rb', line 58 def initialize(address, = {}) @address = address @options = .dup.freeze unless @app_metadata = [:app_metadata] raise ArgumentError, 'App metadata is required' end @socket = nil @pid = Process.pid @compressor = nil @hello_ok = false end |