升级默认的连接管理的实现
This commit is contained in:
@ -31,7 +31,11 @@ func (c *connection) Store(ctx *context.WSContext) {
|
||||
c.table.Set(ctx.ConnectionID, ctx)
|
||||
}
|
||||
|
||||
func (c *connection) Del(ctx *context.WSContext) {
|
||||
func (c *connection) Del(ctx *context.WSContext, message string) {
|
||||
if len(message) > 0 {
|
||||
_ = ctx.Session.Write([]byte(message))
|
||||
_ = ctx.Session.Close()
|
||||
}
|
||||
c.table.Del(ctx.ConnectionID)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user