network

package
v0.30.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckPortAvailable

func CheckPortAvailable(port int) bool

CheckPortAvailable returns true if the given TCP port is free on localhost.

func GetFreePort

func GetFreePort() (int, error)

GetFreePort asks the OS for an available TCP port by binding to port 0.

func ResolvePort

func ResolvePort(desired int) (actual int, shifted bool, warning string)

ResolvePort checks if the desired port is available. If not, it finds a free port and returns it along with a boolean indicating whether a shift occurred. The warning message is returned for the caller to display.

Types

This section is empty.

Jump to

Keyboard shortcuts

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