Skip to content
This repository was archived by the owner on Jun 16, 2024. It is now read-only.

Latest commit

 

History

History
44 lines (28 loc) · 813 Bytes

File metadata and controls

44 lines (28 loc) · 813 Bytes

netpool

Build Status GoDoc

Connection Pool

Install

go get github.com/tristanwietsma/netpool

Usage

Create a connection pool

p, err := netpool.NewConnectionPool("<type>", "<server ip address>", <pool size>)

Get a connection from the pool

c, err := p.Connect()

Use a connection

Connections implement Write and Read.

err := c.Write([]byte("ping"))
msg, err := c.Read()

Return a connection to the pool

p.Release(c)

Testing

Build and start the echoServer, then go test as normal.