pool

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NetConnectPool

type NetConnectPool struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

NetConnectPool 网络连接池

func NewNetPool

func NewNetPool(ip string, port, poolCount int) (*NetConnectPool, error)

NewNetPool 初始化网络连接池 Get 完后记得Put回去!

func (*NetConnectPool) Closes

func (p *NetConnectPool) Closes()

Closes 关闭所有连接

func (*NetConnectPool) FreeCount

func (p *NetConnectPool) FreeCount() int

FreeCount 空闲连接数

func (*NetConnectPool) Get

func (p *NetConnectPool) Get() (conn net.Conn)

Get 取得连接

func (*NetConnectPool) Put

func (p *NetConnectPool) Put(conn net.Conn)

Put 放回连接池

Jump to

Keyboard shortcuts

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