Fix disconnect() bug
I just forgot to set the _state to _DISCONNECTING while disconnecting.
This commit is contained in:
parent
0d9161fd1e
commit
47a8014b4c
1 changed files with 5 additions and 1 deletions
|
|
@ -258,7 +258,11 @@ class Connection:
|
|||
if self._state != self._RUNNING:
|
||||
raise IncorrectStateException("This should never happen.")
|
||||
|
||||
# Now, we can properly disconnect ^^
|
||||
# Now we're sure we're in the _RUNNING state, we can set our state.
|
||||
# Important: No await-ing has occurred between checking the state and
|
||||
# setting it.
|
||||
self._state = self._DISCONNECTING
|
||||
|
||||
await self._disconnect()
|
||||
|
||||
await self._event_loop
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue