示例#1
0
        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();
        }
示例#2
0
        //{"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
            {
            }
        }
示例#3
0
 public WebSocketHandler(WebSocketConnectionManager webSocketConnectionManager)
 {
     WebSocketConnectionManager = webSocketConnectionManager;
 }