示例#1
0
        public void Run()
        {
            int lastTrial = 600;

            while (_bKeepRunning)
            {
                if (bovcli == null && lastTrial > 600)
                {
                    bovcli       = new BovespaClientSinal();
                    bovcli.Debug = false;

                    if (this.ultimoMsgId != null && this.ultimoMsgId.Length > 0)
                    {
                        bovcli.LastMsg = this.ultimoMsgId;
                    }
                    else
                    {
                        bovcli.LastMsg = DateTime.Now.ToString("yyyyMMddA0006000002");
                    }

                    bovcli.OnConnect      += new BovespaOnConnectEventHandler(OnBovespaConnect);
                    bovcli.OnDataReceived += new BovespaDataReceivedEventHandler(OnBovespaDataReceived);
                    bovcli.OnDisconnect   += new BovespaOnDisconnectEventHandler(OnBovespaDisconnect);
                    bovcli.OnError        += new BovespaOnErrorEventHandler(OnBovespaError);

                    bovcli.Connect(parametros.ServidorProxyDiff, Convert.ToString(parametros.PortaProxyDiff));

                    lastTrial = 0;
                }
                else
                {
                    lastTrial++;
                }

                Thread.Sleep(100);
            }
        }
示例#2
0
文件: Form1.cs 项目: radtek/Gradual
 private void btConectar_Click(object sender, EventArgs e)
 {
     bovcli.LastMsg = txtRequestMsg.Text;
     bovcli.Connect("10.10.91.32", "15000");
 }