优化建立连接
This commit is contained in:
@ -24,9 +24,10 @@ func main() {
|
||||
type Example struct {
|
||||
}
|
||||
|
||||
func (e Example) Connect(ctx *context.WSContext) {
|
||||
func (e Example) Connect(ctx *context.WSContext) error {
|
||||
fmt.Println("建立连接成功")
|
||||
message.Response(ctx, map[string]interface{}{"say": "hello world!", "cid": ctx.ConnectionID})
|
||||
return nil
|
||||
}
|
||||
|
||||
func (e Example) Disconnect(ctx *context.WSContext) {
|
||||
|
Reference in New Issue
Block a user