优化网络层

This commit is contained in:
boyce
2026-01-08 14:37:12 +08:00
parent 330644cebb
commit 2e4863d073
14 changed files with 94 additions and 60 deletions

View File

@@ -127,9 +127,11 @@ func NewRClient(targetNodeId string, addr string, maxRpcParamLen uint32, compres
c.NewAgent = client.NewClientAgent
if maxRpcParamLen > 0 {
c.MaxMsgLen = maxRpcParamLen
c.MaxReadMsgLen = maxRpcParamLen
c.MaxWriteMsgLen = maxRpcParamLen
} else {
c.MaxMsgLen = math.MaxUint32
c.MaxReadMsgLen = math.MaxUint32
c.MaxWriteMsgLen = math.MaxUint32
}
client.IRealClient = c
client.CallSet = callSet

View File

@@ -91,9 +91,11 @@ func (server *Server) Start() error {
server.rpcServer.Addr = ":" + splitAddr[1]
server.rpcServer.MinMsgLen = 2
if server.maxRpcParamLen > 0 {
server.rpcServer.MaxMsgLen = server.maxRpcParamLen
server.rpcServer.MaxReadMsgLen = server.maxRpcParamLen
server.rpcServer.MaxWriteMsgLen = server.maxRpcParamLen
} else {
server.rpcServer.MaxMsgLen = math.MaxUint32
server.rpcServer.MaxReadMsgLen = math.MaxUint32
server.rpcServer.MaxWriteMsgLen = math.MaxUint32
}
server.rpcServer.MaxConnNum = 100000