Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TCP6Enabled ¶ added in v1.34.0
func TCP6Enabled() bool
TCP6Enabled returns true if dialing and listening for IPv4 TCP is enabled.
Types ¶
type ConnPool ¶
type ConnPool struct {
// contains filtered or unexported fields
}
ConnPool is a connection pool with ZSTD-compressed connections.
func NewConnPool ¶
NewConnPool creates a new connection pool for the given addr.
Name is used in exported metrics. handshakeFunc is used for handshaking after the connection establishing. The compression is disabled if compressionLevel <= 0.
func (*ConnPool) Get ¶
func (cp *ConnPool) Get() (*handshake.BufferedConn, error)
Get returns free connection from the pool.
func (*ConnPool) Put ¶
func (cp *ConnPool) Put(bc *handshake.BufferedConn)
Put puts bc back to the pool.
Do not put broken and closed connections to the pool!
type TCPDialer ¶
type TCPDialer struct {
// contains filtered or unexported fields
}
TCPDialer is used for dialing the addr passed to NewTCPDialer.
It also gathers various stats for dialed connections.
func NewTCPDialer ¶
NewTCPDialer returns new dialer for dialing the given addr.
The name is used in metric tags for the returned dialer. The name must be unique among dialers.
type TCPListener ¶
TCPListener listens for the addr passed to NewTCPListener.
It also gathers various stats for the accepted connections.
func NewTCPListener ¶
func NewTCPListener(name, addr string) (*TCPListener, error)
NewTCPListener returns new TCP listener for the given addr.
name is used for exported metrics. Each listener in the program must have distinct name.