mirror of
https://github.com/FluuxIO/go-xmpp.git
synced 2026-05-24 04:43:47 -07:00
Close stream before closing connection.
This commit is contained in:
@@ -330,6 +330,7 @@ func NewClientNoTLS(host, user, passwd string, debug bool) (*Client, error) {
|
|||||||
// Close closes the XMPP connection
|
// Close closes the XMPP connection
|
||||||
func (c *Client) Close() error {
|
func (c *Client) Close() error {
|
||||||
if c.conn != (*tls.Conn)(nil) {
|
if c.conn != (*tls.Conn)(nil) {
|
||||||
|
fmt.Fprintf(c.stanzaWriter, "</stream:stream>\n")
|
||||||
return c.conn.Close()
|
return c.conn.Close()
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
Reference in New Issue
Block a user