mirror of
https://github.com/FluuxIO/go-xmpp.git
synced 2026-05-23 04:23:45 -07:00
Set shutdown earlier to further reduce probability of races.
This commit is contained in:
@@ -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, "</stream:stream>\n")
|
||||
go func() {
|
||||
<-time.After(10 * time.Second)
|
||||
|
||||
Reference in New Issue
Block a user