Commit 9124c5ca authored by suyanlong's avatar suyanlong

Add Port const Capacity value

parent ed23830e
Pipeline #8011 canceled with stages
......@@ -42,7 +42,7 @@ func NewPort(client plugins.Client, cryptor txcrypto.Cryptor, logger logrus.Fiel
recvCh: make(chan *pb.IBTP, 1024),
ctx: ctx,
cancel: cancel,
msgCh: make(chan *pb.Message, 10),
msgCh: make(chan *pb.Message, port.Capacity),
}, nil
}
......
......@@ -26,7 +26,7 @@ func newLocal(id peer.ID) *local {
return &local{
id: id,
tag: Office,
rev: make(chan *pb.Message, 10),
rev: make(chan *pb.Message, port.MaxCapacity),
}
}
......
......@@ -13,7 +13,7 @@ type sidecar struct {
}
func newSidecar(id string, tag string, swarm *Swarm) *sidecar {
rec := make(chan *pb.Message, 10)
rec := make(chan *pb.Message, port.Capacity)
return &sidecar{
id: id,
swarm: swarm,
......
......@@ -9,3 +9,9 @@ const (
Appchain = "appchain" // 区块链客户端
Local = "local"
)
const (
MinCapacity = 1
Capacity = 10
MaxCapacity = 1024
)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment