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
|
// Close closes the XMPP connection
|
||||||
func (c *Client) Close() error {
|
func (c *Client) Close() error {
|
||||||
|
c.shutdown = true
|
||||||
if c.conn != (*tls.Conn)(nil) {
|
if c.conn != (*tls.Conn)(nil) {
|
||||||
c.shutdown = true
|
|
||||||
fmt.Fprintf(c.stanzaWriter, "</stream:stream>\n")
|
fmt.Fprintf(c.stanzaWriter, "</stream:stream>\n")
|
||||||
go func() {
|
go func() {
|
||||||
<-time.After(10 * time.Second)
|
<-time.After(10 * time.Second)
|
||||||
|
Loading…
Reference in New Issue
Block a user