重构并新增结点服务发现接口

This commit is contained in:
boyce
2020-10-17 20:05:56 +08:00
parent f60f4670c3
commit 8fc24a8653
7 changed files with 304 additions and 168 deletions

View File

@@ -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()
}
}