Skip to content
This repository was archived by the owner on Sep 15, 2024. It is now read-only.

Commit 3aaa2bf

Browse files
small fix
1 parent bda398d commit 3aaa2bf

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

Scripts/Netcode/Client/ENetClient.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ public async static Task Stop()
212212
//CancelTokenSource.Cancel();
213213
ENetCmds.Enqueue(new ENetCmd(ENetOpcode.ClientWantsToDisconnect));
214214

215-
while (!CancelTokenSource.IsCancellationRequested)
215+
while (Running)
216216
await Task.Delay(100);
217217
}
218218

Scripts/Netcode/Server/ENetServer.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ public async Task ENetThreadWorker(ushort port, int maxClients)
171171
while (ConcurrentQueuesWorking())
172172
await Task.Delay(100);
173173

174+
Running = false;
174175
Stopped();
175176

176177
if (QueueRestart)
@@ -218,12 +219,11 @@ public static async Task Stop()
218219
return;
219220
}
220221

221-
Running = false;
222222
CancelTokenSource.Cancel();
223223

224224
KickAll(DisconnectOpcode.Stopping);
225225

226-
while (!CancelTokenSource.IsCancellationRequested)
226+
while (Running)
227227
await Task.Delay(100);
228228
}
229229

0 commit comments

Comments
 (0)