From 4d2976c7e63409ff781d393a2d87e053e1bb1cae Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Fri, 5 Mar 2021 20:21:44 +0100 Subject: [PATCH] Use TCP_NODELAY on the socket, it may be better to make test_buffering relevant --- irctest/client_mock.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/irctest/client_mock.py b/irctest/client_mock.py index 8ce1583..9bfeeb4 100644 --- a/irctest/client_mock.py +++ b/irctest/client_mock.py @@ -17,6 +17,11 @@ class ClientMock: def connect(self, hostname: str, port: int) -> None: self.conn = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + + # probably useful for test_buffering, as it relies on chunking + # the packets to be useful + self.conn.setsockopt(socket.SOL_TCP, socket.TCP_NODELAY, 1) + self.conn.settimeout(1) # TODO: configurable self.conn.connect((hostname, port)) if self.show_io: