增加服务退出时, finish hook支持
This commit is contained in:
@ -23,7 +23,7 @@ import (
|
||||
)
|
||||
|
||||
func main() {
|
||||
websocket.NewWebsocketServe(&Example{})
|
||||
_ = websocket.NewWebsocketServe(nil, &Example{})
|
||||
}
|
||||
|
||||
type Example struct {
|
||||
@ -31,7 +31,7 @@ type Example struct {
|
||||
|
||||
func (e Example) Connect(ctx *context.WSContext) error {
|
||||
fmt.Println("建立连接成功")
|
||||
message.Response(ctx, map[string]interface{}{"say": "hello world!", "cid": ctx.ConnectionID})
|
||||
_ = message.Response(ctx, map[string]interface{}{"say": "hello world!", "cid": ctx.ConnectionID})
|
||||
return nil
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user