Commit d85efec7 authored by ge0rg's avatar ge0rg

reconnect: fix callback when not currently connected

The 'disconnected' event is normally fired from connection_lost(), which
is called by the connection code when the connection is lost after being
established. However, if the connection wasn't successfully established,
a manual /reconnect no-ops because it waits for the 'disconnected'
callback which never fires. This patch does two things:

1. Immediately fire a 'disconnected' event in disconnect() if there is
   no transport.

2. Register the 'disconnected' event handler in reconnect() *before* it
   can be fired.
parent 115c2345
Pipeline #2855 passed with stages
in 1 minute and 8 seconds