Should I be able to run multiple session on the same port with in 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.
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:
[SESSION]
TargetCompID=CLIENT1
SocketAcceptPort=5011
HeartBtInt=30
[SESSION]
TargetCompID=CLIENT2
SocketAcceptPort=5011
HeartBtInt=30
Is this config valid i.e. using multiple session on the same port with the same comp id differing only by Sender/Target SUbId?
Thanks, Nick
An acceptor can accept multiple connections on the same port, but they must have unique TargetCompIDs.