portspool

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2024 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PortPool

type PortPool struct {
	// contains filtered or unexported fields
}

PortPool 是端口池的结构体

func NewPortPool

func NewPortPool(minPort, maxPort int) *PortPool

NewPortPool 创建一个新的端口池

func (*PortPool) GetPort

func (p *PortPool) GetPort() (int, error)

GetPort 从端口池中获取一个可用端口

func (*PortPool) ReturnPort

func (p *PortPool) ReturnPort(port int) error

ReturnPort 归还一个端口到端口池中

Jump to

Keyboard shortcuts

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