Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update from latest master, fix some typos #1

Merged
merged 32 commits into from
Jun 10, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
9298f97
Add RefreshOnLogon functionality.
martinadams Nov 16, 2014
4bc599b
Add new Application Callback (non-breaking) for early intercept of in…
martinadams Nov 17, 2014
adb2761
Merge branch 'add_refresh' into rx_intercept
martinadams Nov 24, 2014
4ed14c5
Dynamic session configuration.
martinadams Dec 2, 2014
469392f
Merge branch 'add_refresh' into dynamic_sessions
martinadams Dec 2, 2014
446d42e
Merge branch 'rx_intercept' into dynamic_sessions
martinadams Dec 2, 2014
42ddebe
Dynamic sessions
martinadams Dec 14, 2014
234ff56
Revert "Fix distributed deadlock between two sessions"
gbirchmeier Jan 2, 2015
2e61171
release notes
gbirchmeier Jan 2, 2015
4f3abdc
these should have been committed long ago
gbirchmeier Mar 19, 2015
662313c
Merge pull request #290 from martinadams/add_refresh
gbirchmeier May 7, 2015
ddea749
attribution for #290
gbirchmeier May 7, 2015
5820c4e
Changes as requested to tab/indents and comments
martinadams May 13, 2015
646f43d
Unit Test + minor code updates for dynamic sessions
martinadams May 18, 2015
aaacb04
Revert "Merge branch 'rx_intercept' into dynamic_sessions"
martinadams May 19, 2015
43b73f6
Dynamic sessions: whitespace fix only
martinadams May 19, 2015
65eeeaf
Merge pull request #291 from martinadams/rx_intercept
mgatny Jun 1, 2015
fdfe748
(#80) AT: logon with reset after disconnect
gbirchmeier Jun 8, 2015
b632b69
Merge pull request #316 from gbirchmeier/80reset
gbirchmeier Jun 8, 2015
fb2f776
(#80) acceptor shouldn't include 141=Y in logon responses
gbirchmeier Jun 8, 2015
c138736
Merge pull request #317 from gbirchmeier/80reset
gbirchmeier Jun 8, 2015
2b82403
get rid of unnecessary and inexplicable gitignore files
gbirchmeier Jun 8, 2015
42024f2
Merge pull request #318 from gbirchmeier/gitignore
gbirchmeier Jun 8, 2015
dd07716
don't include unneeded sessions in AT config files
gbirchmeier Jun 8, 2015
0d51ac7
Merge pull request #319 from gbirchmeier/atcfg
gbirchmeier Jun 8, 2015
fe57992
Revert "these should have been committed long ago"
gbirchmeier Jun 9, 2015
33dd7b0
Merge pull request #320 from gbirchmeier/badcommit
gbirchmeier Jun 9, 2015
74eba12
ignore a generated AT cfg
gbirchmeier Jun 9, 2015
b132023
Merge branch 'dynamic_sessions' of github.com:martinadams/quickfixn i…
gbirchmeier Jun 9, 2015
bb191ce
Merge branch 'master' into 314
gbirchmeier Jun 9, 2015
5d17cc3
typos and wording changes
gbirchmeier Jun 10, 2015
a8153fe
attribution for #314
gbirchmeier Jun 10, 2015
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ ChangeLog
AcceptanceTest/AcceptanceTests*.html
AcceptanceTest/AcceptanceTests*.xml
AcceptanceTest/TestResult.xml
AcceptanceTest/bin/Debug/*
AcceptanceTest/bin/Release/*
AcceptanceTest/bin/
AcceptanceTest/obj/
AcceptanceTest/log/
AcceptanceTest/store/
AcceptanceTest/cfg/at.cfg
Examples/Executor/bin/*
Examples/Executor/obj/*
Examples/Executor/log/
Expand Down
1 change: 0 additions & 1 deletion AcceptanceTest/cfg/.gitignore

This file was deleted.

14 changes: 1 addition & 13 deletions AcceptanceTest/cfg/at_44.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,5 @@ TargetCompID=TW
ResetOnLogon=Y
FileStorePath=store
[SESSION]
BeginString=FIX.4.0
DataDictionary=..\spec\fix\FIX40.xml
[SESSION]
BeginString=FIX.4.1
DataDictionary=..\spec\fix\FIX41.xml
[SESSION]
BeginString=FIX.4.2
DataDictionary=..\spec\fix\FIX42.xml
[SESSION]
BeginString=FIX.4.3
DataDictionary=..\spec\fix\FIX43.xml
[SESSION]
BeginString=FIX.4.4
DataDictionary=..\spec\fix\FIX44.xml
DataDictionary=..\spec\fix\FIX44.xml
15 changes: 15 additions & 0 deletions AcceptanceTest/cfg/at_44_noreset.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[DEFAULT]
Verbose=Y
FileLogPath=log
ConnectionType=acceptor
SocketAcceptPort=5005
SocketReuseAddress=Y
StartTime=00:00:00
EndTime=00:00:00
SenderCompID=ISLD
TargetCompID=TW
ResetOnLogon=N
FileStorePath=store
[SESSION]
BeginString=FIX.4.4
DataDictionary=..\spec\fix\FIX44.xml
17 changes: 1 addition & 16 deletions AcceptanceTest/cfg/at_50.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,8 @@ SenderCompID=ISLD
TargetCompID=TW
ResetOnLogon=Y
FileStorePath=store
[SESSION]
BeginString=FIX.4.0
DataDictionary=..\spec\fix\FIX40.xml
[SESSION]
BeginString=FIX.4.1
DataDictionary=..\spec\fix\FIX41.xml
[SESSION]
BeginString=FIX.4.2
DataDictionary=..\spec\fix\FIX42.xml
[SESSION]
BeginString=FIX.4.3
DataDictionary=..\spec\fix\FIX43.xml
[SESSION]
BeginString=FIX.4.4
DataDictionary=..\spec\fix\FIX44.xml
[SESSION]
BeginString=FIXT.1.1
DefaultApplVerID=FIX.5.0
AppDataDictionary=..\spec\fix\FIX50.xml
TransportDataDictionary=..\spec\fix\FIXT11.xml
TransportDataDictionary=..\spec\fix\FIXT11.xml
15 changes: 0 additions & 15 deletions AcceptanceTest/cfg/at_50_sp1.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,6 @@ SenderCompID=ISLD
TargetCompID=TW
ResetOnLogon=Y
FileStorePath=store
[SESSION]
BeginString=FIX.4.0
DataDictionary=..\spec\fix\FIX40.xml
[SESSION]
BeginString=FIX.4.1
DataDictionary=..\spec\fix\FIX41.xml
[SESSION]
BeginString=FIX.4.2
DataDictionary=..\spec\fix\FIX42.xml
[SESSION]
BeginString=FIX.4.3
DataDictionary=..\spec\fix\FIX43.xml
[SESSION]
BeginString=FIX.4.4
DataDictionary=..\spec\fix\FIX44.xml
[SESSION]
BeginString=FIXT.1.1
DefaultApplVerID=FIX.5.0SP1
Expand Down
15 changes: 0 additions & 15 deletions AcceptanceTest/cfg/at_50_sp2.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,6 @@ SenderCompID=ISLD
TargetCompID=TW
ResetOnLogon=Y
FileStorePath=store
[SESSION]
BeginString=FIX.4.0
DataDictionary=..\spec\fix\FIX40.xml
[SESSION]
BeginString=FIX.4.1
DataDictionary=..\spec\fix\FIX41.xml
[SESSION]
BeginString=FIX.4.2
DataDictionary=..\spec\fix\FIX42.xml
[SESSION]
BeginString=FIX.4.3
DataDictionary=..\spec\fix\FIX43.xml
[SESSION]
BeginString=FIX.4.4
DataDictionary=..\spec\fix\FIX44.xml
[SESSION]
BeginString=FIXT.1.1
DefaultApplVerID=FIX.5.0SP2
Expand Down
4 changes: 2 additions & 2 deletions AcceptanceTest/definitions/server/fix44/SessionReset.def
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ E8=FIX.4.49=5535=034=249=ISLD52=<TIME>56=TW112=1
#send a Logon with ResetSeqNumFlag set to Y and with MsgSeqNum of 1
I8=FIX.4.435=A34=149=TW52=<TIME>56=ISLD98=0108=30141=Y
#Expect a response with a Logon with ResetSeqNumFlag set to Y and with MsgSeqNum of 1.
E8=FIX.4.49=6735=A34=149=ISLD52=00000000-00:00:00.00056=TW98=0108=30141=Y10=0
E8=FIX.4.49=6135=A34=149=ISLD52=00000000-00:00:00.00056=TW98=0108=3010=0

#Send TestRequest (MsgSeqNum = 2) expect to receive HeartBeat (MsgSeqNum = 2)
I8=FIX.4.435=134=249=TW52=<TIME>56=ISLD112=1
Expand All @@ -31,4 +31,4 @@ E8=FIX.4.49=5535=034=249=ISLD52=<TIME>56=TW112=1
I8=FIX.4.435=534=349=TW52=<TIME>56=ISLD
E8=FIX.4.49=4935=534=349=ISLD52=00000000-00:00:00.00056=TW10=0

eDISCONNECT
eDISCONNECT
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Issue #80: logon with reset _after_disconnect_

iCONNECT
# logon with reset, because this config has ResetOnLogon=N
I8=FIX.4.435=A34=149=TW52=<TIME>56=ISLD98=0108=30141=Y
E8=FIX.4.49=6135=A34=149=ISLD52=00000000-00:00:00.00056=TW98=0108=3010=0
I8=FIX.4.435=034=249=TW52=<TIME>56=ISLD
I8=FIX.4.435=034=349=TW52=<TIME>56=ISLD
I8=FIX.4.435=034=449=TW52=<TIME>56=ISLD
I8=FIX.4.435=034=549=TW52=<TIME>56=ISLD
I8=FIX.4.435=034=649=TW52=<TIME>56=ISLD
I8=FIX.4.435=034=749=TW52=<TIME>56=ISLD
I8=FIX.4.435=034=849=TW52=<TIME>56=ISLD
I8=FIX.4.435=034=949=TW52=<TIME>56=ISLD

#Send TestRequest, expect HeartBeat response
I8=FIX.4.435=134=1049=TW52=<TIME>56=ISLD112=1
E8=FIX.4.49=5535=034=249=ISLD52=<TIME>56=TW112=1

#Logout and response
I8=FIX.4.435=534=1149=TW52=<TIME>56=ISLD
E8=FIX.4.49=4935=534=349=ISLD52=00000000-00:00:00.00056=TW10=0

eDISCONNECT
iCONNECT

#send a Logon with ResetSeqNumFlag set to Y and with MsgSeqNum of 1
I8=FIX.4.435=A34=149=TW52=<TIME>56=ISLD98=0108=30141=Y
#Expect a response with a Logon with ResetSeqNumFlag set to Y and with MsgSeqNum of 1.
E8=FIX.4.49=6135=A34=149=ISLD52=00000000-00:00:00.00056=TW98=0108=3010=0

#Send TestRequest (MsgSeqNum = 2) expect to receive HeartBeat (MsgSeqNum = 2)
I8=FIX.4.435=134=249=TW52=<TIME>56=ISLD112=1
E8=FIX.4.49=5535=034=249=ISLD52=<TIME>56=TW112=1

# logout message and response
I8=FIX.4.435=534=349=TW52=<TIME>56=ISLD
E8=FIX.4.49=4935=534=349=ISLD52=00000000-00:00:00.00056=TW10=0

eDISCONNECT
4 changes: 2 additions & 2 deletions AcceptanceTest/definitions/server/fix50/SessionReset.def
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ E8=FIXT.1.19=5535=034=249=ISLD52=<TIME>56=TW112=1
#send a Logon with ResetSeqNumFlag set to Y and with MsgSeqNum of 1
I8=FIXT.1.135=A34=149=TW52=<TIME>56=ISLD98=0108=30141=Y1137=7
#Expect a response with a Logon with ResetSeqNumFlag set to Y and with MsgSeqNum of 1.
E8=FIXT.1.19=7435=A34=149=ISLD52=00000000-00:00:00.00056=TW98=0108=30141=Y1137=710=0
E8=FIXT.1.19=6835=A34=149=ISLD52=00000000-00:00:00.00056=TW98=0108=301137=710=0

#Send TestRequest (MsgSeqNum = 2) expect to receive HeartBeat (MsgSeqNum = 2)
I8=FIXT.1.135=134=249=TW52=<TIME>56=ISLD112=1
Expand All @@ -31,4 +31,4 @@ E8=FIXT.1.19=5535=034=249=ISLD52=<TIME>56=TW112=1
I8=FIXT.1.135=534=349=TW52=<TIME>56=ISLD
E8=FIXT.1.19=4935=534=349=ISLD52=00000000-00:00:00.00056=TW10=0

eDISCONNECT
eDISCONNECT
4 changes: 2 additions & 2 deletions AcceptanceTest/definitions/server/fix50sp1/SessionReset.def
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ E8=FIXT.1.19=5535=034=249=ISLD52=<TIME>56=TW112=1
#send a Logon with ResetSeqNumFlag set to Y and with MsgSeqNum of 1
I8=FIXT.1.135=A34=149=TW52=<TIME>56=ISLD98=0108=30141=Y1137=8
#Expect a response with a Logon with ResetSeqNumFlag set to Y and with MsgSeqNum of 1.
E8=FIXT.1.19=7435=A34=149=ISLD52=00000000-00:00:00.00056=TW98=0108=30141=Y1137=810=0
E8=FIXT.1.19=6835=A34=149=ISLD52=00000000-00:00:00.00056=TW98=0108=301137=810=0

#Send TestRequest (MsgSeqNum = 2) expect to receive HeartBeat (MsgSeqNum = 2)
I8=FIXT.1.135=134=249=TW52=<TIME>56=ISLD112=1
Expand All @@ -31,4 +31,4 @@ E8=FIXT.1.19=5535=034=249=ISLD52=<TIME>56=TW112=1
I8=FIXT.1.135=534=349=TW52=<TIME>56=ISLD
E8=FIXT.1.19=4935=534=349=ISLD52=00000000-00:00:00.00056=TW10=0

eDISCONNECT
eDISCONNECT
4 changes: 2 additions & 2 deletions AcceptanceTest/definitions/server/fix50sp2/SessionReset.def
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ E8=FIXT.1.19=5535=034=249=ISLD52=<TIME>56=TW112=1
#send a Logon with ResetSeqNumFlag set to Y and with MsgSeqNum of 1
I8=FIXT.1.135=A34=149=TW52=<TIME>56=ISLD98=0108=30141=Y1137=9
#Expect a response with a Logon with ResetSeqNumFlag set to Y and with MsgSeqNum of 1.
E8=FIXT.1.19=7435=A34=149=ISLD52=00000000-00:00:00.00056=TW98=0108=30141=Y1137=910=0
E8=FIXT.1.19=6835=A34=149=ISLD52=00000000-00:00:00.00056=TW98=0108=301137=910=0

#Send TestRequest (MsgSeqNum = 2) expect to receive HeartBeat (MsgSeqNum = 2)
I8=FIXT.1.135=134=249=TW52=<TIME>56=ISLD112=1
Expand All @@ -31,4 +31,4 @@ E8=FIXT.1.19=5535=034=249=ISLD52=<TIME>56=TW112=1
I8=FIXT.1.135=534=349=TW52=<TIME>56=ISLD
E8=FIXT.1.19=4935=534=349=ISLD52=00000000-00:00:00.00056=TW10=0

eDISCONNECT
eDISCONNECT
1 change: 0 additions & 1 deletion AcceptanceTest/obj/Debug/.gitignore

This file was deleted.

1 change: 0 additions & 1 deletion AcceptanceTest/obj/Release/.gitignore

This file was deleted.

5 changes: 4 additions & 1 deletion NEXT_VERSION.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,8 @@ Changes since the last version (oldest first):
* (minor) #286 - FieldBase.Equals() and .GetHashcode() (steffanu)
* (patch) #287 - sync fix in Session class (steffanu)
* (patch) #275 - SessionID.IsSet() should be used instead of !=SessionID.NOT_SET (akamyshanov)

* (patch) #297 - revert #287
* (patch) #290 - support for RefreshOnLogon (martinadams)
* (patch) #80 - fixes to tag-141-related sequence resets (TomasVetrovsky,akamyshanov,gbirchmeier)
* (minor) #314 - New feature: add/remove sessions dynamically (martinadams)

99 changes: 82 additions & 17 deletions QuickFIXn/AbstractInitiator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public abstract class AbstractInitiator : IInitiator
private HashSet<SessionID> disconnected_ = new HashSet<SessionID>();
private bool isStopped_ = true;
private Thread thread_;
private SessionFactory sessionFactory_ = null;

#region Properties

Expand Down Expand Up @@ -59,18 +60,11 @@ public void Start()
throw new System.ObjectDisposedException(this.GetType().Name);

// create all sessions
SessionFactory factory = new SessionFactory(_app, _storeFactory, _logFactory, _msgFactory);
sessionFactory_ = new SessionFactory(_app, _storeFactory, _logFactory, _msgFactory);
foreach (SessionID sessionID in _settings.GetSessions())
{
Dictionary dict = _settings.Get(sessionID);
string connectionType = dict.GetString(SessionSettings.CONNECTION_TYPE);

if ("initiator".Equals(connectionType))
{
sessionIDs_.Add(sessionID);
sessions_[sessionID] = factory.Create(sessionID, dict);
SetDisconnected(sessionID);
}
AddSession(sessionID, dict);
}

if (0 == sessions_.Count)
Expand All @@ -83,6 +77,65 @@ public void Start()
thread_.Start();
}

/// <summary>
/// Add new session, either at start-up or as an ad-hoc operation
/// </summary>
/// <param name="sessionID">ID of new session<param>
/// <param name="dict">config settings for new session</param></param>
/// <returns>true if session added successfully, false if session already exists or is not an initiator</returns>
public bool AddSession(SessionID sessionID, Dictionary dict)
{
if (dict.GetString(SessionSettings.CONNECTION_TYPE) == "initiator" && !sessionIDs_.Contains(sessionID))
{
Session session = sessionFactory_.Create(sessionID, dict);
lock (sync_)
{
if (!_settings.Has(sessionID)) // session won't be in settings if ad-hoc creation after startup
_settings.Set(sessionID, dict);
sessionIDs_.Add(sessionID);
sessions_[sessionID] = session;
SetDisconnected(sessionID);
}
return true;
}
return false;
}

/// <summary>
/// Ad-hoc removal of an existing session
/// </summary>
/// <param name="sessionID">ID of session to be removed</param>
/// <param name="terminateActiveSession">if true, force disconnection and removal of session even if it has an active connection</param>
/// <returns>true if session removed or not already present; false if could not be removed due to an active connection</returns>
public bool RemoveSession(SessionID sessionID, bool terminateActiveSession)
{
Session session = null;
bool disconnectRequired = false;
lock (sync_)
{
if (sessionIDs_.Contains(sessionID))
{
session = sessions_[sessionID];
if (session.IsLoggedOn && !terminateActiveSession)
return false;

sessions_.Remove(sessionID);
_settings.Remove(sessionID);
disconnectRequired = IsConnected(sessionID) || IsPending(sessionID);
if (disconnectRequired)
SetDisconnected(sessionID);
disconnected_.Remove(sessionID);
sessionIDs_.Remove(sessionID);
OnRemove(sessionID);
}
}
if (disconnectRequired)
session.Disconnect("Dynamic session removal");
if (session != null)
session.Dispose();
return true;
}

/// <summary>
/// Logout existing session and close connection. Attempt graceful disconnect first.
/// </summary>
Expand Down Expand Up @@ -144,12 +197,13 @@ public void Stop(bool force)
{
foreach (Session s in sessions_.Values)
s.Dispose();

sessions_.Clear();
sessionIDs_.Clear();
pending_.Clear();
connected_.Clear();
disconnected_.Clear();
}
sessions_.Clear();
sessionIDs_.Clear();
pending_.Clear();
connected_.Clear();
disconnected_.Clear();
}

public bool IsLoggedOn
Expand Down Expand Up @@ -178,6 +232,14 @@ public bool IsLoggedOn
protected virtual void OnConfigure(SessionSettings settings)
{ }

/// <summary>
/// Implement this to provide custom reaction behavior to an ad-hoc session removal.
/// (This is called after the session is removed.)
/// </summary>
/// <param name="sessionID">ID of session that was removed</param>
protected virtual void OnRemove(SessionID sessionID)
{ }

[System.Obsolete("This method's intended purpose is unclear. Don't use it.")]
protected virtual void OnInitialize(SessionSettings settings)
{ }
Expand Down Expand Up @@ -254,9 +316,12 @@ protected void SetDisconnected(SessionID sessionID)
{
lock (sync_)
{
pending_.Remove(sessionID);
connected_.Remove(sessionID);
disconnected_.Add(sessionID);
if (sessionIDs_.Contains(sessionID))
{
pending_.Remove(sessionID);
connected_.Remove(sessionID);
disconnected_.Add(sessionID);
}
}
}

Expand Down
Loading