(self, metadata=None)
A single attempt to call ismaster.

        Returns a ServerDescription, or raises an exception.
A single attempt to call ismaster.
A single attempt to call ismaster .
def _check_once(self, metadata=None):
        """A single attempt to call ismaster.

        Returns a ServerDescription, or raises an exception.
        """
        address = self._server_description.address
        if self._publish:
            self._listeners.publish_server_heartbeat_started(address)
        with self._pool.get_socket({}) as sock_info:
            response, round_trip_time = self._check_with_socket(
                sock_info, metadata=metadata)
            self._avg_round_trip_time.add_sample(round_trip_time)
            sd = ServerDescription(
                address=address,
                ismaster=response,
                round_trip_time=self._avg_round_trip_time.get())
            if self._publish:
                self._listeners.publish_server_heartbeat_succeeded(
                    address, round_trip_time, response)

            return sd
def _check_once ( self , metadata = None ) : address = self . _server_description . address if self . _publish : self . _listeners . publish_server_heartbeat_started ( address ) with self . _pool . get_socket ( { } ) as sock_info : response , round_trip_time = self . _check_with_socket ( sock_info , metadata = metadata ) self . _avg_round_trip_time . add_sample ( round_trip_time ) sd = ServerDescription ( address = address , ismaster = response , round_trip_time = self . _avg_round_trip_time . get ( ) ) if self . _publish : self . _listeners . publish_server_heartbeat_succeeded ( address , round_trip_time , response ) return sd