mirror of
https://github.com/ppy/osu
synced 2025-03-20 09:57:01 +00:00
Fix connection loop always getting a cancelled token
This commit is contained in:
parent
b573c96c07
commit
4d4d97661e
@ -71,15 +71,16 @@ namespace osu.Game.Online.Multiplayer
|
||||
|
||||
try
|
||||
{
|
||||
// this token will be valid for the scope of this connection.
|
||||
// if cancelled, we can be sure that a disconnect or reconnect is handled elsewhere.
|
||||
var cancellationToken = connectCancelSource.Token;
|
||||
|
||||
while (api.State.Value == APIState.Online)
|
||||
{
|
||||
// ensure any previous connection was disposed.
|
||||
// this will also create a new cancellation token source.
|
||||
await disconnect(false);
|
||||
|
||||
// this token will be valid for the scope of this connection.
|
||||
// if cancelled, we can be sure that a disconnect or reconnect is handled elsewhere.
|
||||
var cancellationToken = connectCancelSource.Token;
|
||||
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
|
||||
Logger.Log("Multiplayer client connecting...", LoggingTarget.Network);
|
||||
|
Loading…
Reference in New Issue
Block a user