mirror of
https://github.com/duanhf2012/origin.git
synced 2026-02-11 13:04:41 +08:00
新增tcpsocket协议
This commit is contained in:
@@ -10,7 +10,8 @@
|
||||
"ServiceList": [
|
||||
"HttpServerService",
|
||||
"SubNet1_Service",
|
||||
"SubNet1_Service1"
|
||||
"SubNet1_Service1",
|
||||
"TcpSocketPbService"
|
||||
],
|
||||
"ClusterNode":["SubNet2.N_Node1","N_Node2"]
|
||||
},
|
||||
|
||||
23
Test/main.go
23
Test/main.go
@@ -3,9 +3,28 @@ package main
|
||||
import (
|
||||
"github.com/duanhf2012/origin/cluster"
|
||||
"github.com/duanhf2012/origin/originnode"
|
||||
"github.com/duanhf2012/origin/sysservice"
|
||||
"github.com/duanhf2012/origin/sysservice/originhttp"
|
||||
"github.com/duanhf2012/origin/network"
|
||||
)
|
||||
|
||||
|
||||
type TcpSocketServerReciver struct {
|
||||
|
||||
}
|
||||
|
||||
func (slf *TcpSocketServerReciver) OnConnected(pClient *network.SClient){
|
||||
|
||||
}
|
||||
|
||||
func (slf *TcpSocketServerReciver) OnDisconnect(pClient *network.SClient){
|
||||
|
||||
}
|
||||
|
||||
func (slf *TcpSocketServerReciver) OnRecvMsg(pClient *network.SClient, pPack *network.MsgBasePack){
|
||||
|
||||
}
|
||||
|
||||
func main() {
|
||||
|
||||
node := originnode.NewOriginNode()
|
||||
@@ -18,9 +37,11 @@ func main() {
|
||||
for _, ca := range nodeCfg.CAFile {
|
||||
httpserver.SetHttps(ca.CertFile, ca.KeyFile)
|
||||
}
|
||||
|
||||
pTcpService := sysservice.NewTcpSocketPbService(":9004",&TcpSocketServerReciver{})
|
||||
httpserver.SetPrintRequestTime(true)
|
||||
|
||||
node.SetupService(httpserver)
|
||||
node.SetupService(httpserver,pTcpService)
|
||||
node.Init()
|
||||
node.Start()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user