tcp

package
v0.5.9-hotfix-3 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IPv4Loopback

func IPv4Loopback() netip.Addr

IPv4Loopback returns the IPv4 loopback address.

func Listen

func Listen(addr netip.AddrPort) (net.Listener, error)

Listen opens a TCP listener on the given address. It takes into account the reserved addresses (in tests) and sets the SO_REUSEPORT. nolint: contextcheck

func Norm

func Norm(addr netip.AddrPort) netip.AddrPort

Norm normalizes address by unmapping IPv4 -> IPv6 embedding.

func TestReserveAddr

func TestReserveAddr() netip.AddrPort

TestReserveAddr (testonly) reserves a port in ephemeral range to open a TCP listener on it. Reservation prevents race conditions with other processes.

Types

This section is empty.

Jump to

Keyboard shortcuts

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