sock_test

package
v0.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 13, 2026 License: MIT, MIT Imports: 0 Imported by: 0

Documentation

Overview

Package sock_test provides user-facing examples for using `code.hybscloud.com/sock`.

The examples stay at the same boundary available to application code. They create sockets with `sock`, observe `iox.ErrWouldBlock` in pure non-blocking mode, use `iox.Backoff` in caller-owned retry loops, enable deadline-driven adaptive retry inside `sock`, and hand raw file descriptors to caller-owned loops or runtimes above `sock`.

Reading Order

Start with these files:

  1. `tcp_test.go` for stream dial/listen flow, adaptive deadlines, and non-blocking semantics.
  2. `udp_test.go` for unconnected and connected datagram flow.
  3. `event_loop_test.go` for manual accept loops, `iox.Backoff`, `FD().Raw()`, and the boundary to `uring` or higher runtimes such as `urex`.

Run the examples with:

go test -v code.hybscloud.com/sock/examples

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL