Receive a raw BSON message or raise ConnectionFailure. If any exception is raised, the socket is closed.
(self, request_id: Optional[int])
| 448 | await self._raise_connection_failure(error) |
| 449 | |
| 450 | async def receive_message(self, request_id: Optional[int]) -> Union[_OpReply, _OpMsg]: |
| 451 | """Receive a raw BSON message or raise ConnectionFailure. |
| 452 | |
| 453 | If any exception is raised, the socket is closed. |
| 454 | """ |
| 455 | try: |
| 456 | return await async_receive_message(self, request_id, self.max_message_size) |
| 457 | # Catch KeyboardInterrupt, CancelledError, etc. and cleanup. |
| 458 | except BaseException as error: |
| 459 | await self._raise_connection_failure(error) |
| 460 | |
| 461 | def _raise_if_not_writable(self, unacknowledged: bool) -> None: |
| 462 | """Raise NotPrimaryError on unacknowledged write if this socket is not |
no test coverage detected