module
Version:
v1.0.2
Opens a new window with list of versions in this module.
Published: Apr 26, 2021
License: MIT
Opens a new window with license information.
README
¶
tcp-based-on-gf-gtcp
介绍
基于gf-gtcp的二次小封装,主要是用gmap组合了conn/client/自定义uid,以便可以从服务端快速向指定的客户端发送消息
安装教程
go get gitee.com/hello-rong/gfgtcp
使用示例
package main
import (
"gitee.com/hello-rong/gfgtcp/svr"
"github.com/gogf/gf/net/gtcp"
)
func main() {
server := svr.NewServerService
server.SetServerAddress("127.0.0.1:8999")
server.SetServerName("svr0")
server.SetMessageHandler(onMessage)
_ = server.NewServer()
}
func onMessage(conn *gtcp.Conn, message []byte) {
//......
}
Directories
¶
Click to show internal directories.
Click to hide internal directories.