wait for message when close connection

This commit is contained in:
zhouyuyan
2017-10-26 16:11:01 +08:00
parent a7fb7f1912
commit 208a7cf0a8

View File

@@ -470,6 +470,8 @@ func (c *client) Close() {
if c.status == Disconnected {
return
}
//wait for message complete
time.Sleep(time.Second)
c.smu.Lock()
c.status = Disconnected