/// <summary> /// Constructor used by the DI /// </summary> /// <param name="storeEvents">The service used to store the data</param> /// <param name="optionsWebScoket">The IOptions that contains the web socket configurations</param> /// <param name="logger">The injected logger</param> public WebSocketService(IStoreData storeEvents, IOptions <WebSocketConfiguration> optionsWebScoket, ILogger <WebSocketService> logger) { this.logger = logger; webSocketConfiguration = optionsWebScoket.Value; //with these options the socket will never go over the 60 seconds timeout socketOptions = new PureWebSocketOptions() { DebugMode = webSocketConfiguration.DebugMode, SendDelay = webSocketConfiguration.SendDelay, MyReconnectStrategy = new ReconnectStrategy( webSocketConfiguration.MinReconnectInterval, webSocketConfiguration.MaxReconnectInterval, null ) }; this.storeEvents = storeEvents; }
public WebSocketServer(WebSocketConfiguration configuration) { this.Configuration = configuration; }