xnet

package
v2.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2024 License: MIT Imports: 3 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssignRandPort

func AssignRandPort(ip ...string) (int, error)

AssignRandPort 分配一个随机端口

func ExternalIP

func ExternalIP() (string, error)

ExternalIP 获取外网IP地址

func ExtractIP

func ExtractIP(addr net.Addr) (string, error)

ExtractIP 提取主机地址

func ExtractPort

func ExtractPort(addr net.Addr) (int, error)

ExtractPort 提取主机端口

func FulfillAddr

func FulfillAddr(addr string) string

FulfillAddr 补全地址

func IP2Long added in v2.1.0

func IP2Long(ip string) uint32

IP2Long IP地址转换为长整型

func InternalIP

func InternalIP() (string, error)

InternalIP 获取内网IP地址

func Long2IP added in v2.1.0

func Long2IP(v uint32) string

Long2IP 长整型转换为字符串地址

Types

This section is empty.

Jump to

Keyboard shortcuts

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