python通过QuickFix连接到多个会话

问题描述

所以我必须连接到两个(2)会话(同一主机不同的端口),所以我使用了两个不同的启动器

    application = Application()

    settings = quickfix.SessionSettings(config_file)  # stream settings
    storefactory = quickfix.FileStoreFactory(settings)
    logfactory = quickfix.FileLogFactory(settings)
    initiator = quickfix.socketinitiator(
        application,storefactory,settings,logfactory)

    initiator.start()

    application.run()

    initiator.stop()

并在两个会话中使用了两个不同的配置(.cfg)文件

# This is a client (initiator)
[DEFAULT]
DefaultApplVerID=FIX.4.4
 #settings which apply to all the Sessions.
ConnectionType=initiator
 # FIX messages have a sequence ID,which shouldn't be used for uniqueness as specification doesn't guarantee anything about them. If Y is provided every time logon message is sent,server will reset the sequence.
FileLogPath=./Logs/
 #Path where logs will be written
StartTime=00:00:00
 # Time when session starts and ends
EndTime=00:00:00
UseDataDictionary=Y
 #Time in seconds before your session will expire,keep sending heartbeat requests if you don't want it to expire
ReconnectInterval=60
logoutTimeout=5
logonTimeout=30
 # Time in seconds before reconnecting
Resetonlogout=N
Resetondisconnect=N
SendRedundantResendRequests=Y
# RefreshOnlogon=Y
SocketNodelay=N
# PersistMessages=Y
ValidateUserDefinedFields=N
ValidateFieldsOutOfOrder=N
# CheckLatency=Y



# session stream
[SESSION]
Resetonlogon=Y
BeginString=FIX.4.4
SenderCompID=TESTING1
TargetCompID=TESTACC1
HeartBtInt=30
SocketConnectPort=4000
SocketConnectHost=127.0.0.1
DataDictionary=./spec/FIX44.xml
FileStorePath=./Sessions/

# session market
[SESSION]
Resetonlogon=Y
BeginString=FIX.4.4
SenderCompID=TESTING2
TargetCompID=TESTACC2
HeartBtInt=30
SocketConnectPort=5000
SocketConnectHost=127.0.0.1
DataDictionary=./spec/FIX44.xml
FileStorePath=./Sessions/

但这不起作用

我看到一则他们推荐使用ThreadedSocketinitiator的帖子,但我认为它不用于python quickfix lib。

预先感谢

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...