netcfg: enhance TCP socket listing with queue sizes
TCP sockets in /scheme/netcfg/sockets/list now display: tcp: Established 10.0.0.1:80 -> 10.0.0.2:1234 sendq=0/128 recvq=0/128 Fields added: - sendq: bytes queued for transmission (send_queue / send_capacity) - recvq: bytes waiting in receive buffer (recv_queue / recv_capacity) Mirrors Linux 'ss -tm' output showing send-Q and recv-Q. All 31 tests pass.
This commit is contained in:
@@ -219,10 +219,15 @@ fn mk_root_node(
|
||||
let local = tcp_sock.local_endpoint();
|
||||
let remote = tcp_sock.remote_endpoint();
|
||||
let state = tcp_sock.state();
|
||||
out.push_str(&format!("tcp: {:?} {} -> {}\n",
|
||||
let sq = tcp_sock.send_queue();
|
||||
let rq = tcp_sock.recv_queue();
|
||||
let sc = tcp_sock.send_capacity();
|
||||
let rc = tcp_sock.recv_capacity();
|
||||
out.push_str(&format!("tcp: {:?} {} -> {} sendq={}/{} recvq={}/{}\n",
|
||||
state,
|
||||
local.map(|e| format!("{}", e)).unwrap_or_else(|| "-".to_string()),
|
||||
remote.map(|e| format!("{}", e)).unwrap_or_else(|| "-".to_string())));
|
||||
remote.map(|e| format!("{}", e)).unwrap_or_else(|| "-".to_string()),
|
||||
sq, sc, rq, rc));
|
||||
}
|
||||
if let smoltcp::socket::Socket::Udp(udp_sock) = socket {
|
||||
let endpoint = udp_sock.endpoint();
|
||||
|
||||
Reference in New Issue
Block a user