From 0c6bc7d4dbb6ff1972f210d6d4bc6a168e8d2ce1 Mon Sep 17 00:00:00 2001 From: Leo Bernard Date: Tue, 6 Feb 2024 21:43:09 +0100 Subject: [PATCH] :bug: Fix buffer size limit being too high on Windows --- midi-script/Socket.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/midi-script/Socket.py b/midi-script/Socket.py index a4866bc..026a21f 100755 --- a/midi-script/Socket.py +++ b/midi-script/Socket.py @@ -113,9 +113,9 @@ def init_socket(self, try_stored=False): self._socket.bind(self._server_addr) port = self._socket.getsockname()[1] - # Get the chunk limit of the socket, minus 1 for the ordering byte + # Get the chunk limit of the socket, minus 100 for some headroom self._chunk_limit = self._socket.getsockopt( - socket.SOL_SOCKET, socket.SO_SNDBUF) - 1 + socket.SOL_SOCKET, socket.SO_SNDBUF) - 100 logger.info("Chunk limit: " + str(self._chunk_limit))