public MessageHandler(WebSocketConnectionManager webSocketConnectionManager) : base(webSocketConnectionManager) { gameManagerService = new GameManagerService(this); //this.integratedOrderBookHandler = integratedOrderBookHandler; //integratedOrderBookHandler.OrderBookUpdateItem += OnOrderBookUpdateItem; //this.integratedOrderBookHandler.Start(); //pingScheduler = new Task(PingScheduler); //pingScheduler.Start(); }
//{"Method":"orderbook","Pair":"ETH-BTC"} //{"Method":"orderbook","Pair":"ETH-BTC","Depth":1} private void HandleMessage(string request, WebSocket socket) { try { JObject jsonToken = JsonConvert.DeserializeObject <JObject>(request); var method = jsonToken["Method"].ToString(); switch (method) { case "mapGame": gameManagerService.GetCommand(request, WebSocketConnectionManager.GetSocketIdBySocket(socket)); break; default: break; } } catch { } }
public WebSocketHandler(WebSocketConnectionManager webSocketConnectionManager) { WebSocketConnectionManager = webSocketConnectionManager; }