Increase UDP buffer size and adjust recvfrom limit in UDP server
Some checks are pending
CI / release (push) Waiting to run
CI / debug (push) Waiting to run
CI / release_executable (push) Waiting to run
CI / debug_executable (push) Waiting to run
CI / check-phpunit (push) Waiting to run
CI / check-phpdoc (push) Waiting to run
CI / generate-phpdoc (push) Blocked by required conditions
CI / test (push) Blocked by required conditions
CI / release-documentation (push) Blocked by required conditions
CI / release-artifacts (push) Blocked by required conditions

This commit is contained in:
netkas 2025-03-27 13:12:58 -04:00
parent bb8698bff9
commit f36a7f8563
Signed by: netkas
GPG key ID: 4D8629441B76E4CC

View file

@ -303,12 +303,13 @@ class MultiProtocolServer:
def _start_udp_server(self): def _start_udp_server(self):
with socket.socket(socket.AF_INET, socket.SOCK_DGRAM) as udp_socket: with socket.socket(socket.AF_INET, socket.SOCK_DGRAM) as udp_socket:
udp_socket.setsockopt(socket.SOL_SOCKET, socket.SO_RCVBUF, 1024 * 1024)
udp_socket.bind((self.host, self.port)) udp_socket.bind((self.host, self.port))
self.logger.debug(f"UDP server running on {self.host}:{self.port}") self.logger.debug(f"UDP server running on {self.host}:{self.port}")
while not self.stop_event.is_set(): while not self.stop_event.is_set():
try: try:
data, address = udp_socket.recvfrom(4096) data, address = udp_socket.recvfrom(65535)
self._handle_udp_client(data, address) self._handle_udp_client(data, address)
except Exception as e: except Exception as e:
self.logger.error(f"UDP server error: {e}") self.logger.error(f"UDP server error: {e}")