Documentation ¶
Index ¶
- func NewTcpServer(addr string, opsFunc ...func(h *TcpHandle))
- type Pool
- type PoolItem
- type PoolObj
- type TcpClient
- type TcpCloseFunc
- type TcpHandle
- func (h *TcpHandle) Close()
- func (h *TcpHandle) GetAddr() string
- func (h *TcpHandle) GetMid() uint64
- func (h *TcpHandle) Send(msg *deal.Msg)
- func (h *TcpHandle) SetCloseFunc(f TcpCloseFunc)
- func (h *TcpHandle) SetHandleFunc(handleFunc TcpHandleFunc)
- func (h *TcpHandle) SetInitFunc(f TcpInitFunc)
- func (h *TcpHandle) Status() bool
- type TcpHandleFunc
- type TcpInitFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewTcpServer ¶
Types ¶
type PoolItem ¶
type PoolItem struct { sync.RWMutex Objs chan *PoolObj // 最小数量 IdMin int // 最大数量 IdMax int // 当前数量 总数 Num int32 LifeTime int64 Addr string }
连接池对象
type TcpCloseFunc ¶
type TcpCloseFunc func(h *TcpHandle)
type TcpHandle ¶
type TcpHandle struct { //value map[string]interface{} *common.Cache // tcp状态 sync.RWMutex // contains filtered or unexported fields }
func NewTcpHandle ¶
func (*TcpHandle) SetHandleFunc ¶
func (h *TcpHandle) SetHandleFunc(handleFunc TcpHandleFunc)
设置包处理函数
type TcpHandleFunc ¶
type TcpInitFunc ¶
type TcpInitFunc func(h *TcpHandle)
Click to show internal directories.
Click to hide internal directories.