我是否可以在QuickFix / n中使用同一端口运行多个会话?
我有以下配置
[DEFAULT]
ConnectionType=acceptor
ReconnectInterval=2
FileStorePath=store
FileLogPath=fixlog
PersistMessages=N
StartTime=00:00:00
EndTime=00:00:00
LogoutTimeout=5
ResetOnLogon=Y
UseDataDictionary=Y
ValidateFieldsOutOfOrder=N
AllowUnknownMsgFields=Y
ValidateUserDefinedFields=N
ValidateFieldsHaveValues=N
AppDataDictionary=config/fix/FIX50SP2.xml
TransportDataDictionary=config/fix/FIXT11.xml
BeginString=FIXT.1.1
DefaultApplVerID=FIX.5.0SP2
HeartBtInt=30
SenderCompID=MERCURIA
SenderSubID=1
SocketAcceptPort=5011
[SESSION]
TargetCompID=CLIENT1
SocketAcceptPort=5011
TargetSubID=1
HeartBtInt=30
[SESSION]
TargetCompID=CLIENT1
SocketAcceptPort=5011
TargetSubID=2
HeartBtInt=30
[SESSION]
TargetCompID=CLIENT1
SocketAcceptPort=5011
TargetSubID=3
HeartBtInt=30
但是当我运行它然后以subId为1登录到CLIENT 1时,我得到“远程主机强行关闭现有连接”错误。
2015-07-10 09:34:33,729 [21] INFO Mercuria.Olympus.FixInterface.Common.Cracker.Log4NetLog [(null)] - OnEvent - FIXT.1.1:MERCURIA/1->CLIENT1/1 - Responding to logon request
2015-07-10 09:34:33,733 [21] INFO Mercuria.Olympus.FixInterface.Common.Cracker.FixInterfaceApplication [(null)] - OnLogon Called
2015-07-10 09:34:36,069 [BackgroundTasks] DEBUG Mercuria.Olympus.Common.Core.EntityData.EntityCacheManager [(null)] - Id=Common.ExtendedProductCacheManager, SupplyRows=21249
2015-07-10 09:34:36,116 [BackgroundTasks] DEBUG Mercuria.Olympus.Common.Core.EntityData.EntityCacheManager [(null)] - EntityCacheManager Id=Common.ExtendedProductCacheManager, EntityUpdateCount=21249
2015-07-10 09:35:03,739 [21] INFO Mercuria.Olympus.FixInterface.Common.Cracker.FixInterfaceApplication [(null)] - OUT ADMIN 8=FIXT.1.19=6835=034=249=MERCURIA50=152=20150710-08:35:03.73956=CLIENT157=110=038
2015-07-10 09:35:03,740 [21] INFO Mercuria.Olympus.FixInterface.Common.Cracker.Log4NetLog [(null)] - OnOutgoing - FIXT.1.1:MERCURIA/1->CLIENT1/1 - 8=FIXT.1.19=6835=034=249=MERCURIA50=152=20150710-08:35:03.73956=CLIENT157=110=038
2015-07-10 09:35:04,670 [21] INFO Mercuria.Olympus.FixInterface.Common.Cracker.Log4NetLog [(null)] - OnEvent - FIXT.1.1:MERCURIA/1->CLIENT1/1 - Session FIXT.1.1:MERCURIA/1->CLIENT1/1 disconnecting: Socket exception (127.0.0.1:47045): An existing connection was forcibly closed by the remote host
2015-07-10 09:35:04,671 [21] INFO Mercuria.Olympus.FixInterface.Common.Cracker.FixInterfaceApplication [(null)] - OnLogout Called
如果我将会话配置更改为具有不同的发送组件,则可以正常工作:
[SESSION]
TargetCompID=CLIENT1
SocketAcceptPort=5011
HeartBtInt=30
[SESSION]
TargetCompID=CLIENT2
SocketAcceptPort=5011
HeartBtInt=30
这个配置是否有效,即在相同的端口上使用多个会话,同一个comp id仅由Sender / Target SUbId不同?
谢谢, 尼克
答案 0 :(得分:1)
接受者可以在同一端口上接受多个连接,但它们必须具有唯一的TargetCompID。