mirror of
https://salsa.debian.org/mdosch/go-sendxmpp
synced 2024-11-18 21:25:31 +00:00
Defer closing of xmpp connection.
This commit is contained in:
parent
acb758c982
commit
feaa866e0e
4
main.go
4
main.go
@ -446,7 +446,7 @@ func main() {
|
||||
signal.Notify(c, os.Interrupt)
|
||||
go func() {
|
||||
for range c {
|
||||
client.Close()
|
||||
defer client.Close()
|
||||
os.Exit(0)
|
||||
}
|
||||
}()
|
||||
@ -613,5 +613,5 @@ func main() {
|
||||
// Wait for a short time as some messages are not delivered by the server
|
||||
// if the connection is closed immediately after sending a message.
|
||||
time.Sleep(defaultSleepTime * time.Millisecond)
|
||||
client.Close()
|
||||
defer client.Close()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user