gtcpsvr

package module
v0.0.0-...-7871201 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 24, 2020 License: MIT Imports: 0 Imported by: 0

README

tcp-based-on-gf-gtcp

介绍

基于gf-gtcp的二次小封装,主要是用gmap组合了conn/client/自定义uid,以便可以从服务端快速向指定的客户端发送消息

安装教程

go get gitee.com/hello-rong/tcp-based-on-gf-gtcp

使用示例
package main

import (
	"gitee.com/hello-rong/tcp-based-on-gf-gtcp/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) {
    //......
}

Documentation

Index

Constants

View Source
const AUTHORS = "tianye<315959139@qq.com>"
View Source
const VERSION = "v1.0.1"

Variables

This section is empty.

Functions

This section is empty.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL