示例#1
0
 //状态变化
 private void _onConnectionStatus(object sender, XAPI.ConnectionStatus brokerStatus, ref RspUserLoginField userLogin, int size1)
 {
     FreeQuant.Framework.ConnectionStatus status = ConvertUtil.ConvertConnectionStatus(brokerStatus);
     mOnStatusChanged?.Invoke(status);
     //
     LogUtil.SysLog("交易状态:" + brokerStatus.ToString());
 }
示例#2
0
        private void XApi_OnConnectionStatus(object sender, XAPI.ConnectionStatus status, ref XAPI.RspUserLoginField userLogin, int size1)
        {
            if (onConnectionStatus == null)
            {
                return;
            }

            LoginInfo loginInfo = StructTransfer.TransferUserLogin(userLogin);

            onConnectionStatus(sender, EnumTransfer.TransferConnectionStatus(status), ref loginInfo);
        }
示例#3
0
        /// <summary>
        /// 转换连接状态
        /// </summary>
        /// <param name="borkerStatus"></param>
        /// <returns></returns>
        public static FreeQuant.Framework.ConnectionStatus ConvertConnectionStatus(XAPI.ConnectionStatus borkerStatus)
        {
            switch (borkerStatus)
            {
            case XAPI.ConnectionStatus.Done:
                return(FreeQuant.Framework.ConnectionStatus.Connected);

            case XAPI.ConnectionStatus.Disconnected:
                return(FreeQuant.Framework.ConnectionStatus.Disconnected);

            default:
                return(FreeQuant.Framework.ConnectionStatus.Connecting);
            }
        }