简体   繁体   English

QuickFix/n 同一端口上的多个会话

[英]QuickFix/n multiple Session on the same port

Should I be able to run multiple session on the same port with in QuickFix/n?我应该能够在 QuickFix/n 的同一个端口上运行多个会话吗?

I have the following config我有以下配置

[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

but when I run this and then logon to CLIENT 1 with a subId of 1 I get "An existing connection was forcibly closed by the remote host" error.但是当我运行它然后使用 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

This works alright if I change the session config to have different send compids like so:如果我将会话配置更改为具有不同的发送 compid,则可以正常工作:

[SESSION]
TargetCompID=CLIENT1
SocketAcceptPort=5011
HeartBtInt=30
[SESSION]
TargetCompID=CLIENT2
SocketAcceptPort=5011
HeartBtInt=30

Is this config valid ie using multiple session on the same port with the same comp id differing only by Sender/Target SUbId?此配置是否有效,即在同一端口上使用多个会话,并且具有相同的 comp id,仅通过 Sender/Target SUbId 不同?

Thanks, Nick谢谢,尼克

接受者可以在同一端口上接受多个连接,但是它们必须具有唯一的TargetCompID。

You need a unique session id您需要一个唯一的会话 ID

The easiest way is to change the qualifier in each session, you can keep the sender and target the same that way最简单的方法是在每个会话中更改限定符,您可以通过这种方式保持发送者和目标相同

SessionQualifier=Fxgo2

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM