net

package
v0.0.0-...-ad9b26c Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Extract

func Extract(hostPort string, lis net.Listener) (string, error)

Extract returns a private addr and port.

func ExtractHostPort

func ExtractHostPort(addr string) (host string, port uint64, err error)

ExtractHostPort from address

func GenerateIpAndPort

func GenerateIpAndPort(ipAddress *string, portAddress *int)

GenerateIpAndPort 生成默认的ip和地址

func GetCommandLineIpAndPort

func GetCommandLineIpAndPort(defaultIp string, defaultPort int) (string, int)

GetCommandLineIpAndPort 获取命令行的ip和地址

func GetFreePort

func GetFreePort() (int, error)

GetFreePort 获取当前主机空闲的端口

func IsValidIP

func IsValidIP(addr string) bool

func IsValidPort

func IsValidPort(port int) bool

IsValidPort check if the port is legal. 0 is considered as a non valid port.

func ParseHostAndPort

func ParseHostAndPort(endpoint string) (host string, port string, err error)

func Port

func Port(lis net.Listener) (int, bool)

Port return a real port.

Types

This section is empty.

Jump to

Keyboard shortcuts

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