lib/mongo/server/connection_pool.rb
def connect_connection(connection)
        begin
          connection.connect!
        rescue Exception
          connection.disconnect!(reason: :error)
          raise
        end
      rescue Error::SocketError, Error::SocketTimeoutError => exc
        @server.unknown!(
          generation: exc.generation,
          service_id: exc.service_id,
          stop_push_monitor: true,
        )
        raise
      end
# Attempts to connect (handshake and auth) the connection. If an error is
# encountered, closes the connection and raises the error.
Attempts to connect (handshake and auth) the connection. If an error is
encountered, closes the connection and raises the error.
Attempts to connect ( handshake and auth ) the connection . If an error is encountered closes the connection and raises the error .
def connect_connection(connection)
        begin
          connection.connect!
        rescue Exception
          connection.disconnect!(reason: :error)
          raise
        end
      rescue Error::SocketError, Error::SocketTimeoutError => exc
        @server.unknown!(
          generation: exc.generation,
          service_id: exc.service_id,
          stop_push_monitor: true,
        )
        raise
      end
def connect_connection ( connection ) begin connection . connect! rescue Exception connection . disconnect! ( reason : :error ) raise end rescue Error :: SocketError , Error :: SocketTimeoutError => exc @server . unknown! ( generation : exc . generation , service_id : exc . service_id , stop_push_monitor : true , ) raise end
Attempts to connect (handshake and auth) the connection.
Attempts to connect ( handshake and auth ) the connection .
connection