我正在尝试使用C#中的QuickFix创建一个FIX接受器应用程序...我遇到一个奇怪的问题我似乎无法解决...当尝试创建一个新的ThreadedSocketAcceptor时,构造函数是抛出FormatException,说“字符串未被识别为有效的DateTime”。我不确定是什么导致这个因为我的配置文件中唯一的日期时间是会话时间...这是我的代码片段和相应的接受器配置文件:
SessionSettings settings = new SessionSettings(SettingInfo);
application = new TFAcceptorApplication();
application.DataArrived += new DataArrivedEventHandler(DataArrivedEvent);
FileStoreFactory storeFactory = new FileStoreFactory( settings );
FileLogFactory logFactory = new FileLogFactory( settings );
DefaultMessageFactory messageFactory = new DefaultMessageFactory();
acceptor = new ThreadedSocketAcceptor(application, storeFactory, settings, logFactory, messageFactory);
acceptor.Start();
配置文件:
[DEFAULT]
ConnectionType=acceptor
SocketAcceptPort=9999
SocketReuseAddress=Y
FileStorePath=store
FileLogPath=log
[SESSION]
BeginString=FIX.4.4
SenderCompID=MySenderCompId
TargetCompID=MyTargetCompId
UseDataDictionary=N
DataDictionary=FIX44.xml
StartTime=00:00:00
EndTime=23:59:00
我尝试的任何东西似乎都无法工作,每次我到达该代码时都会抛出异常。任何人遇到类似问题并知道可能导致什么问题的任何机会?
感谢您抽出宝贵时间阅读我的问题, 干杯!
编辑:堆栈跟踪 -
mscorlib.dll!System.DateTimeParse.ParseExact(string s, string format, System.Globalization.DateTimeFormatInfo dtfi, System.Globalization.DateTimeStyles style) + 0x6b bytes
mscorlib.dll!System.DateTime.ParseExact(string s, string format, System.IFormatProvider provider, System.Globalization.DateTimeStyles style) + 0x32 bytes
QuickFix.dll!QuickFix.Util.UtcDateTimeSerializer.FromString(string s) + 0x5c bytes
QuickFix.dll!QuickFix.FileStore.InitializeSessionCreateTime() + 0xf1 bytes
QuickFix.dll!QuickFix.FileStore.open() + 0x29 bytes
QuickFix.dll!QuickFix.FileStore.FileStore(string path, QuickFix.SessionID sessionID) + 0x187 bytes
QuickFix.dll!QuickFix.FileStoreFactory.Create(QuickFix.SessionID sessionID) + 0x5c bytes
QuickFix.dll!QuickFix.Session.Session(QuickFix.IApplication app, QuickFix.IMessageStoreFactory storeFactory, QuickFix.SessionID sessID, QuickFix.DataDictionaryProvider dataDictProvider, QuickFix.SessionSchedule sessionSchedule, int heartBtInt, QuickFix.ILogFactory logFactory, QuickFix.IMessageFactory msgFactory, string senderDefaultApplVerID) + 0x229 bytes
QuickFix.dll!QuickFix.SessionFactory.Create(QuickFix.SessionID sessionID, QuickFix.Dictionary settings) + 0x432 bytes
QuickFix.dll!QuickFix.ThreadedSocketAcceptor.CreateSessions(QuickFix.SessionSettings settings) + 0x110 bytes
QuickFix.dll!QuickFix.ThreadedSocketAcceptor.ThreadedSocketAcceptor(QuickFix.SessionFactory sessionFactory, QuickFix.SessionSettings settings) + 0xd1 bytes
QuickFix.dll!QuickFix.ThreadedSocketAcceptor.ThreadedSocketAcceptor(QuickFix.IApplication application, QuickFix.IMessageStoreFactory storeFactory, QuickFix.SessionSettings settings, QuickFix.ILogFactory logFactory, QuickFix.IMessageFactory messageFactory) + 0x4b bytes
> ExecutionReportGenerator.exe!ExecutionReportGenerator.ExecutionForm.StartConnection() Line 194 + 0x3d bytes C#
ExecutionReportGenerator.exe!ExecutionReportGenerator.ExecutionForm.ConnectButton_Click(object sender, System.EventArgs e) Line 87 + 0x8 bytes C#
System.Windows.Forms.dll!System.Windows.Forms.Control.OnClick(System.EventArgs e) + 0x70 bytes
System.Windows.Forms.dll!System.Windows.Forms.Button.OnClick(System.EventArgs e) + 0x4a bytes