Ejemplo n.º 1
0
        static void DoSockets()
        {
            RECEIVEORDERGATEWAY orderGateway = new RECEIVEORDERGATEWAY();
            ConnectMessageModel connectModel = new ConnectMessageModel();
            SocketClient        socketClient = new SocketClient("membersim.bseindia.com", 8082, new MessageManager(), new TcpReceiver());

            socketClient.SendMessage(orderGateway);
            socketClient.SendMessage(connectModel);
            GetMarketByPriceModel getMarket = new GetMarketByPriceModel();

            socketClient.SendMessage(getMarket);

            /*GetMarketByPriceModel marketByPrice = new GetMarketByPriceModel();
             * marketByPrice.LoginId = 97;
             * marketByPrice.SessionKey = newOrder.SessionKey;
             * marketByPrice.KeyIdentifier = newOrder.OEToken + "^" + newOrder.OEBSEToken + "^" + newOrder.OEMarket;
             * socketClient.SendMessage(marketByPrice);
             */
            /*OrderAndTrade.AddOrder newOrder = new OrderAndTrade.AddOrder();
             * AddArbitrageMarketWatchTokensModel arbitrage = new AddArbitrageMarketWatchTokensModel();
             * arbitrage.LoginId = 97;
             * arbitrage.SessionKey = newOrder.SessionKey;
             * arbitrage.KeyIdentityFier = newOrder.OEToken + "^" + newOrder.OEBSEToken + "^" + newOrder.OEMarket;
             * socketClient.SendMessage(arbitrage);*/
            //Client("Open Market by price=" + marketByPrice.OpenMarketByPrice + "|Internal USID=" + marketByPrice.LoginId + "|SessionKey=" + marketByPrice.SessionKey + "|KeyIdentifier=" + marketByPrice.KeyIdentifier);

            // Client(marketByPrice.OpenMarketByPrice + "|" + marketByPrice.LoginId + "|" + marketByPrice.SessionKey + "|" + marketByPrice.KeyIdentifier);
        }
Ejemplo n.º 2
0
        static void AddTcpOrder()
        {
            ConnectMessageModel connectMessageModel = new ConnectMessageModel();
            SocketClient        socketClient        = new SocketClient("membersim.bseindia.com", 8083, new MessageManager(), new TcpReceiver());

            socketClient.SendMessage(connectMessageModel);
            try { Models.WebSocket.AddOrder order = new Models.WebSocket.AddOrder();
                  socketClient.SendMessage(order);
                  var messaege = order.Message; }

            catch (Exception ex)
            {
                var exept = ex.Message;
            }

            //  socketClient.SendMessage(order);
        }
Ejemplo n.º 3
0
        static void DoSockets()
        {
            RECEIVEORDERGATEWAY orderGateway = new RECEIVEORDERGATEWAY();
            ConnectMessageModel connectModel = new ConnectMessageModel();
            var          manager             = new MessageManager();
            SocketClient socketClient        = new SocketClient("membersim.bseindia.com", 8082, manager, new TcpReceiver());

            socketClient.SendMessage(orderGateway);
            socketClient.SendMessage(connectModel);
            GetMarketByPriceModel getMarketByPriceModel = new GetMarketByPriceModel();

            socketClient.SendMessage(getMarketByPriceModel);

            /* var markets = GetMarkets();
             * foreach(var market in markets)
             * {
             * socketClient.SendMessage(market);
             * }
             * Thread.Sleep(10000);
             * var marketss = manager.marketUpdates;
             * foreach (var m in marketss) Debug.WriteLine(m.ToString());*/
            /*GetMarketByPriceModel marketByPrice = new GetMarketByPriceModel();
             * marketByPrice.LoginId = 97;
             * marketByPrice.SessionKey = newOrder.SessionKey;
             * marketByPrice.KeyIdentifier = newOrder.OEToken + "^" + newOrder.OEBSEToken + "^" + newOrder.OEMarket;
             * socketClient.SendMessage(marketByPrice);
             */
            /*OrderAndTrade.AddOrder newOrder = new OrderAndTrade.AddOrder();
             * AddArbitrageMarketWatchTokensModel arbitrage = new AddArbitrageMarketWatchTokensModel();
             * arbitrage.LoginId = 97;
             * arbitrage.SessionKey = newOrder.SessionKey;
             * arbitrage.KeyIdentityFier = newOrder.OEToken + "^" + newOrder.OEBSEToken + "^" + newOrder.OEMarket;
             * socketClient.SendMessage(arbitrage);*/
            //Client("Open Market by price=" + marketByPrice.OpenMarketByPrice + "|Internal USID=" + marketByPrice.LoginId + "|SessionKey=" + marketByPrice.SessionKey + "|KeyIdentifier=" + marketByPrice.KeyIdentifier);

            // Client(marketByPrice.OpenMarketByPrice + "|" + marketByPrice.LoginId + "|" + marketByPrice.SessionKey + "|" + marketByPrice.KeyIdentifier);
        }