我正在使用“http://www.quickfixengine.org”中的 python 代码示例并且有一个问题。我使用下面显示的代码段创建我的应用程序
import quickfix
if len(sys.argv) < 2: return
fileName = sys.argv[1]
try:
settings = quickfix.SessionSettings(fileName)
application = quickfix.MyApplication()
storeFactory = quickfix.FileStoreFactory(settings)
logFactory = quickfix.FileLogFactory(settings)
initiator = quickfix.SocketInitiator(application, storeFactory, settings, logFactory)
initiator.start()
# while condition == true: do something
initiator.stop()
except quickfix.ConfigError, e:
print e
建立连接并登录,现在我想发送一条消息(例如订单)。为此提供的代码段是:
def sendOrderCancelRequest:
message = quickfix.Message();
header = message.getHeader();
header.setField(...)
*<...build the header and body...>*
message.setField(...)
Session.sendToTarget(message)
我的问题是关于那个Session
物体的。它是在哪里/如何创建的?它是用类似的东西创建的Session = quickfix.Session()
,还是他们没有显示的其他东西?我已经尝试了一些东西,但是由于缺乏文档,它只是反复试验......