Use Transport in Component

This commit is contained in:
Wichert Akkerman
2019-10-11 06:24:47 +02:00
committed by Mickaël Rémond
parent 96fccbd399
commit e97d290e2b
2 changed files with 18 additions and 22 deletions

View File

@@ -191,9 +191,8 @@ func (c *Client) Resume(state SMState) error {
func (c *Client) Disconnect() {
_ = c.SendRaw("</stream:stream>")
// TODO: Add a way to wait for stream close acknowledgement from the server for clean disconnect
conn := c.transport
if conn != nil {
_ = conn.Close()
if c.transport != nil {
_ = c.transport.Close()
}
}