forked from jshiffer/go-xmpp
Close stream before closing connection.
This commit is contained in:
parent
b7ea9f4be1
commit
9684a8ff69
1
xmpp.go
1
xmpp.go
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user