假设我正在运行一个基于网络的交易平台,并且有一个新客户注册。我给那个客户一个新的 CompID,现在我想将该 CompID 添加到我的接受者。我必须重新启动我的接受器还是可以动态完成?
必须提前就 CompID 达成一致,然后将其粘贴在某处的配置中,这似乎不是很可扩展。
这是在 quicfixj 中完成的,但我想在 quickfixc++ 中完成,我应该怎么做?
最佳答案
根据 how to create dynamic sessions using QuickFix你可以这样做:
SessionSettings settings = new SessionSettings();
SessionID id1 = new SessionID(new BeginString("FIX.4.2"),
new SenderCompID("FixServer"),
new TargetCompID("Client1"), "Session1");
Dictionary d = new Dictionary();
d.setString("ConnectionType", "acceptor");
d.setLong("SocketAcceptPort", 5001);
d.setString("FileLogPath", "Log");
d.setString("StartTime", "00:00:00");
d.setString("EndTime", "00:00:00");
d.setString("FileStorePath", @"c:\fixfiles");
d.setBool("UseDataDictionary", true);
d.setString("DataDictionary", @"FIX42.xml");
settings.set(id1,d);
用 C++ 等同于设置一个动态 session ,然后:
acceptor.setSessionProvider(socketAddress, new DynamicAcceptorSessionProvider(
settings, templateSessionID, application, messageStoreFactory, logFactory,
messageFactory));
我认为 C++ 等价物是设置一个 Socket Acceptor
关于c++ - 如何在 c++ 的 quickfixc 中动态地就 SenderCompID 和 TargetCompID 达成一致?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44429148/