{"record":{"id":"81b81ec0efc8b163","repo":"rustdesk/rustdesk","slug":"socket-receive-none-maybe-socks5-server-is-down","errorCode":null,"errorMessage":"Socket receive none. Maybe socks5 server is down.","messagePattern":"Socket receive none\\. Maybe socks5 server is down\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/rendezvous_mediator.rs","lineNumber":338,"sourceCode":"                if (latency - old_latency).abs() > n || old_latency <= 0 {\n                    Config::update_latency(&host, latency);\n                    log::debug!(\"Latency of {}: {}ms\", host, latency as f64 / 1000.);\n                    old_latency = latency;\n                }\n            };\n            select! {\n                n = socket.next() => {\n                    match n {\n                        Some(Ok((bytes, _))) => {\n                            if let Ok(msg) = Message::parse_from_bytes(&bytes) {\n                                rz.handle_resp(msg.union, Sink::Framed(&mut socket, &addr), &server, &mut update_latency).await?;\n                            } else {\n                                log::debug!(\"Non-protobuf message bytes received: {:?}\", bytes);\n                            }\n                        },\n                        Some(Err(e)) => bail!(\"Failed to receive next: {}\", e),  // maybe socks5 tcp disconnected\n                        None => {\n                            bail!(\"Socket receive none. Maybe socks5 server is down.\");\n                        },\n                    }\n                },\n                _ = timer.tick() => {\n                    if SHOULD_EXIT.load(Ordering::SeqCst) {\n                        break;\n                    }\n                    // The server already told us this device is not deployed. Skip\n                    // the whole register / fails / latency / UDP-rebind path until\n                    // DEPLOY_RETRY_INTERVAL elapses, otherwise the loop spins every\n                    // few seconds (log spam + misapplied network-recovery rebind)\n                    // until the operator runs `rustdesk --deploy`.\n                    if deploy_register_throttled().await {\n                        continue;\n                    }\n                    let now = Some(Instant::now());\n                    let expired = last_register_resp.map(|x| x.elapsed().as_millis() as i64 >= REG_INTERVAL).unwrap_or(true);\n                    let timeout = last_register_sent.map(|x| x.elapsed().as_millis() as i64 >= reg_timeout).unwrap_or(false);","sourceCodeStart":320,"sourceCodeEnd":356,"githubUrl":"https://github.com/rustdesk/rustdesk/blob/91c9fccbb0f7bfe5f11644d5fbdec9b23fa10540/src/rendezvous_mediator.rs#L320-L356","documentation":"start_udp's select loop treats a None from the framed stream next() as an unrecoverable condition and bails with 'Socket receive none. Maybe socks5 server is down.' The stream closed cleanly (EOF), meaning the rendezvous UDP-over-proxy channel can no longer receive messages.","triggerScenarios":"next() returns None: the socket/proxy stream is closed — commonly the SOCKS5 TCP tunnel ended, or the local socket was shut down.","commonSituations":"SOCKS5 proxy process exiting or dropping idle tunnels, system sleep/resume invalidating the socket, client service stopping mid-session.","solutions":["Check/restart the SOCKS5 proxy server","Restart the RustDesk client so start_udp re-establishes the channel","Investigate proxy idle-timeout settings and raise keepalive intervals","Disable SOCKS5 proxying for the rendezvous connection if not needed","Check system power settings (sleep/resume closes sockets)"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// probe proxy before starting\nif !socks5_probe(proxy_addr).await { warn!(\"socks5 proxy unreachable\"); }","typeGuard":null,"tryCatchPattern":"if let Err(e) = start_udp().await {\n    if e.to_string().contains(\"Maybe socks5 server is down\") {\n        restart_socks5_or_fallback_direct();\n    }\n}","preventionTips":["Run a supervised/auto-restarting SOCKS5 proxy","Raise proxy idle timeouts to survive quiet rendezvous periods","Handle system sleep/resume by re-establishing sockets"],"tags":["network","udp","socks5","socket-closed"],"backgroundTag":"broken-pipe","analyzedSha":"91c9fccbb0f7bfe5f11644d5fbdec9b23fa10540","analyzedAt":"2026-09-10T19:53:44.083Z","contentChangedAt":"2026-09-10T19:53:44.083Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}