private async Task OnMessage(string message, IWebSocketConnection socket) { var logger = this.loggerFactory.CreateLogger("Socket Received"); try { var context = ConnectionContextCreator.Create(socket, connectionLifetimeManager, simpleProtocol, userIdProvider); if (this.simpleProtocol.TryParseMessage(message, out Message messageData)) { await Invoke(messageData, message, context); } } catch (Exception ex) { logger.LogError(ex, ex.Message); } }
private async Task OnOpen(IWebSocketConnection socket) { var context = ConnectionContextCreator.Create(socket, connectionLifetimeManager, simpleProtocol, userIdProvider); await this.connectionLifetimeManager.OnConnectedAsync(context); }