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.
14 lines
437 B
C#
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)
|
|
};
|
|
}
|