Files
spark/src/client/spark_websocket/Core/WebsocketServerConfigExtensions.cs
T
John Colvin eb0fcf0b84 refactor: Rename WebsocketServerConfig proto pkg 'bts.websocket_core'
This matches the namespace used in spark_websocket csproj. Eventually,
I'd like to use conventional capitalization (TitleCase namespaces/types,
etc.), but let's shelf that until we have enough time/energy to do a
more comprehensive refactoring.
2024-07-09 14:59:06 -04:00

14 lines
437 B
C#

namespace bts.websocket_core;
using Microsoft.AspNetCore.Builder;
public static class WebsocketServerConfigExtensions {
public static string Uri(this WebsocketServerConfig config) =>
$"{config.Scheme}://{config.Host}:{config.Port}";
public static WebSocketOptions get_ws_options(this WebsocketServerConfig config) =>
new() {
KeepAliveInterval = TimeSpan.FromSeconds(config.KeepAliveIntervalSecs)
};
}