mirror of
https://github.com/FluuxIO/go-xmpp.git
synced 2025-11-21 17:13:44 -08:00
Add constants (enumlike) for stanza types and simplify packet creation (#62)
* Add constants (enumlike) for stanza types * NewIQ, NewMessage and NewPresence are now initialized with the Attrs struct * Update examples * Do not export backoff code. For now, we do not need to expose backoff in the documentation * Make presence priority an int8
This commit is contained in:
@@ -104,7 +104,7 @@ func (sm *StreamManager) Stop() {
|
||||
|
||||
// connect manages the reconnection loop and apply the define backoff to avoid overloading the server.
|
||||
func (sm *StreamManager) connect() error {
|
||||
var backoff Backoff // TODO: Group backoff calculation features with connection manager?
|
||||
var backoff backoff // TODO: Group backoff calculation features with connection manager?
|
||||
|
||||
for {
|
||||
var err error
|
||||
@@ -118,7 +118,7 @@ func (sm *StreamManager) connect() error {
|
||||
return xerrors.Errorf("unrecoverable connect error %w", actualErr)
|
||||
}
|
||||
}
|
||||
backoff.Wait()
|
||||
backoff.wait()
|
||||
} else { // We are connected, we can leave the retry loop
|
||||
break
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user