コード例 #1
0
ファイル: CtpOrderDriver.cs プロジェクト: handayu/TFS-WebKit
        /// <summary>
        /// 构造CtpOrderDriver实例。
        /// </summary>
        /// <param name="driverType">服务器环境类型。</param>
        /// <param name="address">行情服务器地址。</param>
        /// <param name="port">交易服务器端口。</param>
        /// <param name="connectTimeOut">连接超时时间。</param>
        /// <param name="queryTimeOut">查询超时时间。</param>
        public CtpOrderDriver(USeDriverType driverType, string address, int port, int connectTimeOut, int queryTimeOut, string streamFilePath)
        {
            m_driverType            = driverType;
            m_address               = address;
            m_port                  = port;
            m_connectTimeOut        = connectTimeOut > 0 ? connectTimeOut : DEFAULT_CONNECT_TIMEOUT;
            m_queryTimeOut          = queryTimeOut > 0 ? queryTimeOut : DEFAULT_QUERY_TIMEOUT;
            m_ctpUserStreamFilePath = streamFilePath;

            if (string.IsNullOrEmpty(m_ctpUserStreamFilePath))
            {
                FileInfo fileInfo    = new FileInfo(Process.GetCurrentProcess().MainModule.FileName);
                string   companyName = "USe";
                string   appFolder   = fileInfo.Name.Remove(fileInfo.Name.Length - fileInfo.Extension.Length);
                string   fileName    = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), companyName, appFolder, "CtpUserStream");
                m_ctpUserStreamFilePath = fileName;
            }

            m_logger = new NullLogger("NullLogger<CtpOrderDriver>");

            Initialize();
        }
コード例 #2
0
ファイル: CtpOrderDriver.cs プロジェクト: handayu/TFS-WebKit
 /// <summary>
 /// 构造CtpOrderDriver实例。
 /// </summary>
 /// <param name="driverType">服务器环境类型。</param>
 /// <param name="address">交易服务器地址。</param>
 /// <param name="port">交易服务器端口。</param>
 public CtpOrderDriver(USeDriverType driverType, string address, int port, string streamFilePath)
     : this(driverType, address, port, DEFAULT_CONNECT_TIMEOUT, DEFAULT_QUERY_TIMEOUT, streamFilePath)
 {
 }
コード例 #3
0
ファイル: CtpOrderDriver.cs プロジェクト: handayu/TFS-WebKit
        private System.Threading.Timer m_queryAccountTimer = null; // 定时查询用户资金信息
        #endregion                                                 // member

        #region construction
        /// <summary>
        /// 构造CtpOrderDriver实例。
        /// </summary>
        /// <param name="driverType">服务器环境类型。</param>
        /// <param name="address">交易服务器地址。</param>
        /// <param name="port">交易服务器端口。</param>
        public CtpOrderDriver(USeDriverType driverType, string address, int port)
            : this(driverType, address, port, DEFAULT_CONNECT_TIMEOUT, DEFAULT_QUERY_TIMEOUT, string.Empty)
        {
        }