mirror of
https://github.com/duanhf2012/origin.git
synced 2026-02-03 22:45:13 +08:00
重构并新增结点服务发现接口
This commit is contained in:
@@ -117,7 +117,7 @@ reconnect:
|
||||
}
|
||||
}
|
||||
|
||||
func (client *TCPClient) Close() {
|
||||
func (client *TCPClient) Close(waitDone bool) {
|
||||
client.Lock()
|
||||
client.closeFlag = true
|
||||
for conn := range client.conns {
|
||||
@@ -126,5 +126,8 @@ func (client *TCPClient) Close() {
|
||||
client.conns = nil
|
||||
client.Unlock()
|
||||
|
||||
client.wg.Wait()
|
||||
if waitDone == true{
|
||||
client.wg.Wait()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user