Example #1
0
        public void Connect(string frontAddress, int port)
        {
            this.frontAddress = frontAddress;
            this.port         = port;

            //创建实例
            this._instance = (IntPtr)EsunnyWrapper.InvokeAPI(IntPtr.Zero, EsunnyWrapperAction.CreateQuoteApi, null);

            //创建监听器
            _listener = new EsunnyQuoteListener();
            _listener._esunnyQuote = this;
            EsunnyWrapper.InvokeAPI(this._instance, EsunnyWrapperAction.QuoteSetSpi, this._listener.Instance);

            //设置行情服务器地址
            TEsAddressField addr = new TEsAddressField();

            addr.Ip   = frontAddress;
            addr.Port = port;

            //开始建立连接
            EsunnyWrapper.InvokeAPI(this._instance, EsunnyWrapperAction.QuoteOpen, addr);
        }
Example #2
0
        public void Connect(string frontAddress, int port)
        {
            this.frontAddress = frontAddress;
              this.port = port;

              //创建实例
              this._instance = (IntPtr)EsunnyWrapper.InvokeAPI(IntPtr.Zero, EsunnyWrapperAction.CreateQuoteApi, null);

              //创建监听器
              _listener = new EsunnyQuoteListener();
              _listener._esunnyQuote = this;
              EsunnyWrapper.InvokeAPI(this._instance, EsunnyWrapperAction.QuoteSetSpi, this._listener.Instance);

              //设置行情服务器地址
              TEsAddressField addr = new TEsAddressField();

              addr.Ip = frontAddress;
              addr.Port = port;

              //开始建立连接
              EsunnyWrapper.InvokeAPI(this._instance, EsunnyWrapperAction.QuoteOpen, addr);
        }