fix(battle-node): thread session CT through every send instead of None
This commit is contained in:
@@ -330,7 +330,7 @@ public sealed class BattleSession
|
||||
var sio = SocketIoFrame.BinaryEventWithAttachments(eventName, new[] { bytes });
|
||||
var (text, bins) = sio.Encode();
|
||||
var eioText = $"{(int)EngineIoPacketType.Message}{text}";
|
||||
await SendTextAsync(eioText, CancellationToken.None);
|
||||
await SendTextAsync(eioText, _sessionCt);
|
||||
foreach (var bin in bins)
|
||||
{
|
||||
// Engine.IO v3 binary frames are prefixed with the packet-type byte
|
||||
@@ -338,7 +338,7 @@ public sealed class BattleSession
|
||||
var prefixed = new byte[bin.Length + 1];
|
||||
prefixed[0] = (byte)EngineIoPacketType.Message;
|
||||
Buffer.BlockCopy(bin, 0, prefixed, 1, bin.Length);
|
||||
await _ws.SendAsync(prefixed, WebSocketMessageType.Binary, endOfMessage: true, CancellationToken.None);
|
||||
await _ws.SendAsync(prefixed, WebSocketMessageType.Binary, endOfMessage: true, _sessionCt);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -348,7 +348,7 @@ public sealed class BattleSession
|
||||
var ack = SocketIoFrame.AckResponse(ackId, checked((int)arg));
|
||||
var (text, _) = ack.Encode();
|
||||
var eioText = $"{(int)EngineIoPacketType.Message}{text}";
|
||||
await SendTextAsync(eioText, CancellationToken.None);
|
||||
await SendTextAsync(eioText, _sessionCt);
|
||||
}
|
||||
|
||||
private async Task SendEioOpenAsync(CancellationToken ct)
|
||||
|
||||
Reference in New Issue
Block a user