netutil

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2026 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GracefulCloseConn

func GracefulCloseConn(conn net.Conn, abort <-chan struct{}, gracePeriod time.Duration)

GracefulCloseConn performs a TCP half-close (CloseWrite), giving the remote end time to read any buffered data, then fully closes after gracePeriod. The abort channel can be used to skip the grace period; if nil or never closed, the full grace period is used. Falls back to immediate close for non-TCP connections.

Types

This section is empty.

Jump to

Keyboard shortcuts

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