Per-BattleId slot keyed dict. Pair returns the first arriver to the second; ParkAsync awaits a TCS and returns the second arriver. Timeout defaults to BattleNodeOptions.WaitingRoomTimeout (60s); evict on timeout keeps the dict clean. Singleton in DI; consumed by the handler in the next task.
19 lines
724 B
C#
19 lines
724 B
C#
namespace SVSim.BattleNode.Bridge;
|
|
|
|
/// <summary>
|
|
/// DI-injected options for the battle node. NodeServerUrl matches the prod
|
|
/// do_matching wire format: <c>host:port/socket.io/</c>, no scheme prefix.
|
|
/// BestHTTP's SocketManager parses it as the Socket.IO v2 endpoint URL.
|
|
/// </summary>
|
|
public sealed class BattleNodeOptions
|
|
{
|
|
public string NodeServerUrl { get; set; } = "localhost:5148/socket.io/";
|
|
|
|
/// <summary>
|
|
/// How long the first arriver's WS waits for a partner before disconnecting.
|
|
/// Matches the architecture spec's 60s default; override (typically lower)
|
|
/// in tests via the factory.
|
|
/// </summary>
|
|
public TimeSpan WaitingRoomTimeout { get; set; } = TimeSpan.FromSeconds(60);
|
|
}
|