sockerr

package
v0.3.5 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2026 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Overview

Package sockerr classifies socket errors portably. On Windows, Winsock reports WSAE* codes (WSAECONNREFUSED is 10061), while the syscall.E* constants there are invented values that never match a real socket error; errors.Is(err, syscall.ECONNREFUSED) is therefore always false on Windows. Every check here matches the POSIX errno and, on Windows, its Winsock code.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsAddrInUse

func IsAddrInUse(err error) bool

IsAddrInUse reports a bind to an address already in use (EADDRINUSE).

func IsConnAborted

func IsConnAborted(err error) bool

IsConnAborted reports a connection aborted locally (ECONNABORTED).

func IsConnRefused

func IsConnRefused(err error) bool

IsConnRefused reports an explicit connection refusal (ECONNREFUSED).

func IsConnReset

func IsConnReset(err error) bool

IsConnReset reports a connection reset by the peer (ECONNRESET).

func IsDescriptorExhausted

func IsDescriptorExhausted(err error) bool

IsDescriptorExhausted reports a process or system descriptor limit (EMFILE, ENFILE).

func IsUnreachable

func IsUnreachable(err error) bool

IsUnreachable reports a missing network or host route (ENETUNREACH, EHOSTUNREACH).

Types

This section is empty.

Jump to

Keyboard shortcuts

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