增加管道模式,即本地调用时,发生错误不断开连接状态

This commit is contained in:
boyce
2019-09-25 15:21:56 +08:00
parent 79a6b79397
commit e266c50ed6
2 changed files with 14 additions and 7 deletions

View File

@@ -7,6 +7,7 @@ import (
"os"
"sort"
"strings"
"sync"
"time"
"github.com/duanhf2012/origin/rpc"
@@ -33,6 +34,7 @@ type CCluster struct {
writer net.Conn
LocalRpcClient *rpc.Client
localRpcLocker sync.Mutex
innerLocalServiceList map[string]bool
}
@@ -186,7 +188,7 @@ func (slf *CCluster) ConnService() error {
if slf.LocalRpcClient.IsClosed() {
slf.ReSetLocalRpcClient()
}
time.Sleep(time.Second * 4)
time.Sleep(time.Second * 2)
}
return nil