mirror of
https://github.com/duanhf2012/origin.git
synced 2026-02-03 22:45:13 +08:00
新增自定义持久化的消息队列
This commit is contained in:
@@ -82,9 +82,6 @@ func (client *Client) Connect(id int, addr string, maxRpcParamLen uint32) error
|
||||
func (client *Client) startCheckRpcCallTimer() {
|
||||
for {
|
||||
time.Sleep(5 * time.Second)
|
||||
if client.GetCloseFlag() == true {
|
||||
break
|
||||
}
|
||||
client.checkRpcCallTimeout()
|
||||
}
|
||||
}
|
||||
@@ -348,6 +345,19 @@ func (client *Client) GetId() int {
|
||||
|
||||
func (client *Client) Close(waitDone bool) {
|
||||
client.TCPClient.Close(waitDone)
|
||||
|
||||
client.pendingLock.Lock()
|
||||
for {
|
||||
pElem := client.pendingTimer.Front()
|
||||
if pElem == nil {
|
||||
break
|
||||
}
|
||||
|
||||
pCall := pElem.Value.(*Call)
|
||||
pCall.Err = errors.New("nodeid is disconnect ")
|
||||
client.makeCallFail(pCall)
|
||||
}
|
||||
client.pendingLock.Unlock()
|
||||
}
|
||||
|
||||
func (client *Client) GetClientSeq() uint32 {
|
||||
|
||||
Reference in New Issue
Block a user