mirror of
https://github.com/duanhf2012/origin.git
synced 2026-02-03 22:45:13 +08:00
优化网络层
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user