xs_connect(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… xs_connect β€” connect a socket to a remote endpoint ✨

okay so real talk, this is a page from the Kernel API Manual (section 9, the kernel-dev girly section, iykyk) and honestly? it's giving "small function, big feelings." it's xs_connect(9), bestie, and we're gonna get into it 🫢


✨ SYNOPSIS ✨

void xs_connect (struct rpc_xprt *xprt , struct rpc_task *task );

literally that's it. void, so nothing comes back β€” no return value, no drama, no receipts. she just does the thing πŸ’…


πŸŽ€ ARGUMENTS πŸŽ€

  • xprt β€” pointer to the transport structure. the transport. the whole vibe carrier. she's a struct rpc_xprt * and she's the main character here.
  • task β€” the address of the RPC task that manages the state of the connect request. so like, the task is the one holding the clipboard and tracking where we are in the whole "are we connected yet" journey πŸ“‹βœ¨

πŸ¦‹ DESCRIPTION πŸ¦‹

TCP: if the remote end dropped the connection, delay reconnecting. no cap β€” we're not out here spam-reconnecting the second things get rocky. we wait. we chill. we come back. 🌸

UDP socket connects are synchronous, but we use a work queue anyway β€” and the reason is lowkey iconic: it guarantees that even unprivileged user processes can set up a socket on a privileged port. yes bestie, the work queue is doing the heavy lifting so regular-degular processes can get a privileged port without needing the fancy permissions πŸ‘‘

and if a UDP socket connect fails? the delay behavior here prevents retry floods (hard mounts). πŸ’€ so like, the built-in delay isn't laziness, it's protection β€” otherwise you'd get a whole flood of retries and nobody wants that kind of chaos, especially on hard mounts. the delay is the vibe check. πŸ™ˆ


πŸ’– SEE ALSO πŸ’–

bestie she has a huge friend group, we're listing every single one, no skipping 🫢

Kernel file ./net/sunrpc/xprtsock.c and also: xs_nospace(9), xs_local_send_request(9), xs_udp_send_request(9), xs_tcp_send_request(9), xs_error_report(9), xs_close(9), xs_destroy(9), xs_udp_data_read_skb(9), xs_data_ready(9), xs_local_state_change(9), xs_tcp_state_change(9), xs_udp_write_space(9), xs_tcp_write_space(9), xs_udp_set_buffer_size(9), xs_udp_timer(9), xs_set_port(9), xs_local_setup_socket(9), xs_enable_swap(9), xs_disable_swap(9), xs_tcp_shutdown(9), xs_tcp_setup_socket(9), xs_tls_handshake_done(9), xs_tcp_tls_setup_socket(9), xs_local_print_stats(9), xs_udp_print_stats(9), xs_tcp_print_stats(9), bc_send_request(9), xs_setup_local(9), xs_setup_udp(9), xs_setup_tcp(9), xs_setup_tcp_tls(9), xs_setup_bc_tcp(9), init_socket_xprt(9), cleanup_socket_xprt(9) 🌈


ngl the whole squad is in ./net/sunrpc and they all said hi πŸ‘‹

⭐ and that's the page!! sourced from ./net/sunrpc, dated October 2026 β€” so go forth, connect that socket, delay that reconnect, and slay βœ¨πŸ’œπŸŽ€

πŸ“¦ where this page comes from