diff --git a/xmpp.go b/xmpp.go index 8b66ad4..f5a6758 100644 --- a/xmpp.go +++ b/xmpp.go @@ -370,8 +370,8 @@ func NewClientNoTLS(host, user, passwd string, debug bool) (*Client, error) { // Close closes the XMPP connection func (c *Client) Close() error { + c.shutdown = true if c.conn != (*tls.Conn)(nil) { - c.shutdown = true fmt.Fprintf(c.stanzaWriter, "\n") go func() { <-time.After(10 * time.Second)