Skip to content

Add UdpSocket to the reactor - #18

Merged
pathscale merged 3 commits into
masterfrom
feat/udp-socket
Sep 28, 2026
Merged

pathscale merged 3 commits into
masterfrom
feat/udp-socket

Conversation

@pathscale

Copy link
Copy Markdown
Owner

Adds nagoya::net::UdpSocket (re-exported from nagoya::reactor), needed by the pays.online shred watcher, which receives Solana gossip and Turbine shreds over UDP.

  • bind / bind_reuse_addr / from_socket, local_addr, set_recv_buffer / set_send_buffer
  • poll_recv_from / recv_from, poll_send_to / send_to
  • Zero-copy: recvfrom writes into the caller's slice, with no internal buffer and no allocation per datagram
  • Readiness: after a successful receive the socket is marked readable again (one recv consumes one datagram), so the next poll either gets another datagram or hits EWOULDBLOCK and parks. One waker per direction, so one task can receive while another sends.
  • No recvmmsg batching yet; one datagram per call on every target.

Second commit bumps to 0.1.15, which publishes on merge.

Verified on macOS (kqueue): cargo test --features reactor all pass (10 in reactor_net, including the new UDP tests); cargo check --no-default-features passes; cargo clippy --features reactor --all-targets has no warnings. Linux (epoll) runs in CI.

meh added 3 commits September 29, 2026 02:04
net::UdpSocket: bind, bind_reuse_addr, from_socket, local_addr, recv/send
buffer sizes, and poll_recv_from/recv_from, poll_send_to/send_to. recvfrom
writes straight into the caller's slice: no internal buffer, no allocation
per datagram. Same readiness discipline as TcpStream: one waker per
direction, so one task can receive while another sends.
@pathscale
pathscale merged commit 1902b32 into master Sep 28, 2026
3 checks passed
@pathscale
pathscale deleted the feat/udp-socket branch September 28, 2026 19:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant