Documentation
¶
Overview ¶
+build darwin netbsd freebsd openbsd dragonfly linux
Index ¶
Constants ¶
View Source
const ( AVAILABLEWRITE uint32 = iota UNAVAILABLEWRITE CONN_CLOSE uint32 = iota CONN_OPEN CONN_NEEE_CLOSED )
View Source
const ( POLL_OPENED uint32 = iota POLL_CLOSED )
View Source
const (
CLOSED = 1
)
Variables ¶
View Source
var ( ErrInvalidPoolSize = errors.New("invalid size for pool") ErrInvalidPoolExpiry = errors.New("invalid expiry for pool") ErrPoolClosed = errors.New("this pool has been closed") )
View Source
var ( ErrInputConnWrite = errors.New("input err for conn write") ErrClosedPoll = errors.New("closed for poll") )
Functions ¶
This section is empty.
Types ¶
type AcceptBalance ¶
type AcceptBalance int
const ( Random AcceptBalance = iota RoundRobin LeastConn )
type BaseHandleConn ¶
type BaseHandleConn struct {
}
func (*BaseHandleConn) Handle ¶
func (hc *BaseHandleConn) Handle(conn Conn, packet interface{}, err error)
func (*BaseHandleConn) PreOpen ¶
func (hc *BaseHandleConn) PreOpen(c Conn)
type ConnManger ¶
type ConnManger interface {
Len() int64
CloseAllConn()
}
type HandleConn ¶
type PoolHandle ¶
type PoolHandle struct {
PanicHandler func(interface{})
// contains filtered or unexported fields
}
func NewPoolHandle ¶
func NewTimingPoolHandle ¶
func (*PoolHandle) Cap ¶
func (p *PoolHandle) Cap() int
func (*PoolHandle) Free ¶
func (p *PoolHandle) Free() int
func (*PoolHandle) Release ¶
func (p *PoolHandle) Release() error
func (*PoolHandle) Running ¶
func (p *PoolHandle) Running() int
type Server ¶
type Server interface {
Start() error
Stop()
Serve() error
Listener() net.Listener
SetPreServing(func(server Server))
}
func NewServer ¶
func NewServer(addr string, HandleConn HandleConn, numPollEvent int, acceptBalance AcceptBalance) (Server, error)
type WorkerHandle ¶
type WorkerHandle struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.