forked from jshiffer/go-xmpp
Set shutdown earlier to further reduce probability of races.
This commit is contained in:
parent
2f331ed19c
commit
12a04e0950
2
xmpp.go
2
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 {
|
||||
if c.conn != (*tls.Conn)(nil) {
|
||||
c.shutdown = true
|
||||
if c.conn != (*tls.Conn)(nil) {
|
||||
fmt.Fprintf(c.stanzaWriter, "</stream:stream>\n")
|
||||
go func() {
|
||||
<-time.After(10 * time.Second)
|
||||
|
Loading…
Reference in New Issue
Block a user