[PATCH] rtl_tcp: keep serving after a client that disconnects at once
Hi, I hit this running rtl_tcp on Windows with an RTL-SDR Blog V4: a client that connects and drops right away (port probe, quick reconnect) leaves rtl_tcp accepting TCP connections but never sending the dongle header again until it is restarted. When the client goes away before rtlsdr_read_async() has started, the worker's rtlsdr_cancel_async() is a no-op, read_async then runs forever with do_exit set and the server never gets back to accept(). The attached patch: - rtlsdr_callback(): once do_exit is set, cancel from there and return - command_worker(): recv() == 0 (client closed) ends the session - tcp_worker(): a select() error ends the session; bytesleft/index only move when send() sent something It applies to master (v2.0.3) and builds without warnings. With it the server goes back to accept() after each such client; tested on the same setup. The same fix is in rtlsdrblog/rtl-sdr-blog PR #85. For transparency: I tracked this down and wrote the fix with help from an LLM. I reviewed the change, tested it and am happy to answer questions about it. Regards, Rodrigo Gressler
participants (1)
-
Rodrigo Gressler