Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type IConnGroupMagage ¶ added in v0.1.1
type IConnGroupMagage interface { AddGroup(g connmanage.GroupHook) error RemoveGroup(g connmanage.GroupHook) error Group(g connmanage.GroupHook) (map[int32]struct{}, error) AddConnToGroup(g connmanage.GroupHook, conn int32) error RemoveConnFromGroup(g connmanage.GroupHook, conn int32) error ClearGroup(g connmanage.GroupHook) error }
func NewConnGroup ¶ added in v0.1.1
func NewConnGroup() IConnGroupMagage
type IRouterManage ¶
type IRouterManage interface { RegisterRoute(id int32, route routermanage.RouterHandle) error HandleMessage(routerid, connid, msgid int32, parameter []byte) error }
func NewRouterManage ¶
func NewRouterManage(name string, store store.ITCPStore) IRouterManage
type ITCPConnManage ¶
type ITCPConnManage interface { AddConn(conn connect.ITCPConn) error RemoveConn(conn connect.ITCPConn, err error) error FindConn(id int32) (connect.ITCPConn, error) CheckHealths(context.Context) SetHook(connect.Hook) Hook() connect.Hook AllConn() map[int32]connect.ITCPConn OutTimeOption(string) int64 ReadBuffer() int32 WriteBuffer() int32 }
IConnManage 接口用于管理连接。
func NewConnManage ¶
func NewConnManage(conntype string, store store.ITCPStore, hook connect.Hook, opt ...connmanage.ConnManagerOption) ITCPConnManage
NewConnManage 创建一个新的连接管理器。
type TCPServer ¶
type TCPServer struct {
// contains filtered or unexported fields
}
func NewTCPServer ¶
func NewTCPServer(connManager ITCPConnManage, router IRouterManage, opt ...ServerOption) *TCPServer
NewTCPServer 创建一个tcp服务器 IConnManage:连接管理器实例,IRouterManage:路由管理实例 ,ServerOption:服务器选项
Click to show internal directories.
Click to hide internal directories.