3 Star 7 Fork 7

zcy/tcptemplate

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
main.go 699 Bytes
一键复制 编辑 原始数据 按行查看 历史
zcy 提交于 2020-08-26 22:52 . 修改文档
package main
import (
"flag"
"log"
"runtime"
"tcptemplate/config"
"tcptemplate/logger"
"tcptemplate/network"
)
func main() {
if runtime.GOOS != `linux` {
log.Print("do not support " + runtime.GOOS + " platform")
//return
}
var confPath string
flag.StringVar(&confPath, "conf_path", "TcpServConfig.json", "the path of configuration file")
flag.Parse()
config.InitConfig(confPath)
//network.SetHandler(handler.HandlePack)
server := network.ServerFactory(config.Configs().Ipadress)
server.SetHandler(nil)
log.Print("start " + config.Configs().Type + " server " + "at address " + config.Configs().Ipadress)
e := server.Run()
if nil != e {
logger.LogDebugError(e.Error())
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/290198252/tcpteamplate.git
git@gitee.com:290198252/tcpteamplate.git
290198252
tcpteamplate
tcptemplate
master

搜索帮助