Send a P2P message over the socket. This method takes a P2P payload, builds the P2P header and adds the message to the send buffer to be sent over the socket. When a message does not lead to a disconnect, send_and_ping is usually preferred to send a message. This ca
(self, message, is_decoy=False)
| 388 | # Socket write methods |
| 389 | |
| 390 | def send_without_ping(self, message, is_decoy=False): |
| 391 | """Send a P2P message over the socket. |
| 392 | |
| 393 | This method takes a P2P payload, builds the P2P header and adds |
| 394 | the message to the send buffer to be sent over the socket. |
| 395 | |
| 396 | When a message does not lead to a disconnect, send_and_ping is usually |
| 397 | preferred to send a message. This can help to reduce intermittent test |
| 398 | failures due to a missing sync. Also, it includes a call to |
| 399 | sync_with_ping, allowing for concise test code. |
| 400 | """ |
| 401 | with self._send_lock: |
| 402 | tmsg = self.build_message(message, is_decoy) |
| 403 | self._log_message("send", message) |
| 404 | return self.send_raw_message(tmsg) |
| 405 | |
| 406 | def send_raw_message(self, raw_message_bytes): |
| 407 | if not self.is_connected: |