示例#1
0
        static void Main(string[] args)
        {
            FTAPI.Init();
            FTAPI_Qot client = new FTAPI_Qot();

            client.SetConnCallback(new SampleConnCallback());
            client.SetQotCallback(new SampleQotCallback());
            client.SetClientInfo("FTAPI4NET_Sample", 1);
            //client.SetRSAPrivateKey(System.IO.File.ReadAllText(@"d:\rsa1024", Encoding.UTF8));
            client.InitConnect("127.0.0.1", 11111, false);

            FTAPI_Trd trd = new FTAPI_Trd();

            trd.SetConnCallback(new SampleTrdConnCallback());
            trd.SetTrdCallback(new SampleTrdCallback());
            trd.SetClientInfo("FTAPI4NET_Sample", 1);
            trd.InitConnect("127.0.0.1", 11111, false);

            /*
             * FTClient client = new FTClient("127.0.0.1", 11111);
             * client.QotConnCallback.InitConnected += QotConnCallback_InitConnected;
             * client.QotConnCallback.Disconnected += QotConnCallback_Disconnected;
             * client.Connect();
             */

            while (true)
            {
                Thread.Sleep(1000);
                //client.Close();
                //client.Dispose();
                Thread.Sleep(1000 * 200);
            }
        }
示例#2
0
 public bool InitConnectQotSync(String ip, ushort port)
 {
     qot.SetConnCallback(this);
     qot.SetQotCallback(this);
     lock (qotLock)
     {
         bool ret = qot.InitConnect(ip, port, false);
         if (!ret)
         {
             return(false);
         }
         Monitor.Wait(qotLock);
         return(qotConnStatus == ConnStatus.READY);
     }
 }
示例#3
0
 internal void Connect(string host, ushort port)
 {
     qot.InitConnect(host, port, false);
     //eClientSocket.reqCurrentTime();
 }