Documentation ¶
Index ¶
- Constants
- func GetSysMax() int32
- func Wrapper(p *Pool) net.Conn
- type Conn
- func (cn *Conn) Close() error
- func (cn *Conn) LocalAddr() net.Addr
- func (cn *Conn) Read(b []byte) (n int, err error)
- func (cn *Conn) RemoteAddr() net.Addr
- func (cn *Conn) SetDeadline(t time.Time) error
- func (cn *Conn) SetReadDeadline(t time.Time) error
- func (cn *Conn) SetWriteDeadline(t time.Time) error
- func (cn *Conn) Write(b []byte) (n int, err error)
- type Opts
- type Pool
Constants ¶
View Source
const (
MIN_SIZE = 128
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
func (*Conn) RemoteAddr ¶
type Opts ¶
type Opts []interface{}
func DefaultOpts ¶
func DefaultOpts() Opts
func (Opts) WithContext ¶
func (Opts) WithDialer ¶
func (Opts) WithMinSize ¶
func (Opts) WithTimeout ¶
type Pool ¶
type Pool struct { Deadline struct { // contains filtered or unexported fields } // contains filtered or unexported fields }
func (*Pool) Get ¶
Get one TCP connection from the pool.
If the connection reaches the max limit, poll until one enqueue during TIMEOUT.
If not, set up a new one
func (*Pool) SetDeadline ¶
func (*Pool) SetReadDeadline ¶
func (*Pool) SetWriteDeadline ¶
Click to show internal directories.
Click to hide internal directories.