增加连接的connection_id
This commit is contained in:
@ -26,7 +26,7 @@ type Example struct {
|
||||
|
||||
func (e Example) Connect(ctx *context.WSContext) {
|
||||
fmt.Println("建立连接成功")
|
||||
message.Response(ctx, map[string]interface{}{"say": "hello world!"})
|
||||
message.Response(ctx, map[string]interface{}{"say": "hello world!", "cid": ctx.ConnectionID})
|
||||
}
|
||||
|
||||
func (e Example) Disconnect(ctx *context.WSContext) {
|
||||
|
Reference in New Issue
Block a user