rustdesk/rustdesk · error

Socket receive none. Maybe socks5 server is down.

Error message

Socket receive none. Maybe socks5 server is down.

What it means

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.

Source

Thrown at src/rendezvous_mediator.rs:338

                if (latency - old_latency).abs() > n || old_latency <= 0 {
                    Config::update_latency(&host, latency);
                    log::debug!("Latency of {}: {}ms", host, latency as f64 / 1000.);
                    old_latency = latency;
                }
            };
            select! {
                n = socket.next() => {
                    match n {
                        Some(Ok((bytes, _))) => {
                            if let Ok(msg) = Message::parse_from_bytes(&bytes) {
                                rz.handle_resp(msg.union, Sink::Framed(&mut socket, &addr), &server, &mut update_latency).await?;
                            } else {
                                log::debug!("Non-protobuf message bytes received: {:?}", bytes);
                            }
                        },
                        Some(Err(e)) => bail!("Failed to receive next: {}", e),  // maybe socks5 tcp disconnected
                        None => {
                            bail!("Socket receive none. Maybe socks5 server is down.");
                        },
                    }
                },
                _ = timer.tick() => {
                    if SHOULD_EXIT.load(Ordering::SeqCst) {
                        break;
                    }
                    // The server already told us this device is not deployed. Skip
                    // the whole register / fails / latency / UDP-rebind path until
                    // DEPLOY_RETRY_INTERVAL elapses, otherwise the loop spins every
                    // few seconds (log spam + misapplied network-recovery rebind)
                    // until the operator runs `rustdesk --deploy`.
                    if deploy_register_throttled().await {
                        continue;
                    }
                    let now = Some(Instant::now());
                    let expired = last_register_resp.map(|x| x.elapsed().as_millis() as i64 >= REG_INTERVAL).unwrap_or(true);
                    let timeout = last_register_sent.map(|x| x.elapsed().as_millis() as i64 >= reg_timeout).unwrap_or(false);

View on GitHub (pinned to 91c9fccbb0)

Solutions

  1. Check/restart the SOCKS5 proxy server
  2. Restart the RustDesk client so start_udp re-establishes the channel
  3. Investigate proxy idle-timeout settings and raise keepalive intervals
  4. Disable SOCKS5 proxying for the rendezvous connection if not needed
  5. Check system power settings (sleep/resume closes sockets)
Defensive patterns

Strategy: retry

Validate before calling

// probe proxy before starting
if !socks5_probe(proxy_addr).await { warn!("socks5 proxy unreachable"); }

Try / catch

if let Err(e) = start_udp().await {
    if e.to_string().contains("Maybe socks5 server is down") {
        restart_socks5_or_fallback_direct();
    }
}

Prevention

When it happens

Trigger: next() returns None: the socket/proxy stream is closed — commonly the SOCKS5 TCP tunnel ended, or the local socket was shut down.

Common situations: SOCKS5 proxy process exiting or dropping idle tunnels, system sleep/resume invalidating the socket, client service stopping mid-session.

Related errors


AI-assisted analysis of rustdesk/rustdesk@91c9fccbb0 (2026-09-10). Data as JSON: /api/errors/81b81ec0efc8b163. Report an issue: GitHub.