sock_test

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: MIT, MIT Imports: 0 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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`. The direct examples mainly surface the `iox.ErrWouldBlock` / `sock.ErrInProgress` boundary; the wider `iox` classifier surface (`iox.ErrMore`, `iox.Classify`, `iox.IsSemantic`, `iox.IsProgress`) remains relevant for helpers layered 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 a caller-owned accept loop, `iox.Backoff`, and borrowing a descriptor with `FD().Raw()`.

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