Score
0
Watch 5 Star 35 Fork 16

ryanduan / wsPoolGoMIT

Create your Gitee Account
Explore and code with more than 6 million developers,Free private repositories !:)
Sign up
Clone or download
init.go 501 Bytes
Copy Edit Web IDE Raw Blame History
ryanduan authored 2020-11-24 16:39 . 修复bug
package wsPool
var wsSever *Server
/*连接池的结构体*/
type Server struct {
hub *hub
ErrFun func(err interface{}) //用于接收ws连接池内代码运行时错误信息
}
//初始化执行连接池对象
//参数为接收连接池中运行时的一些错误信息的回调方法
func InitWsPool(errfun func(err interface{})) {
wsSever = new(Server)
wsSever.hub = newHub()
wsSever.ErrFun = errfun
go wsSever.hub.run() //开启服务
//go wsSever.hub.ticker() //开启定时服务
}

Comment ( 0 )

Sign in for post a comment