Skip to content

Commit

Permalink
typos and wording changes
Browse files Browse the repository at this point in the history
  • Loading branch information
gbirchmeier committed Jun 10, 2015
1 parent bb191ce commit 5d17cc3
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 25 deletions.
15 changes: 8 additions & 7 deletions QuickFIXn/AbstractInitiator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public void Start()
/// </summary>
/// <param name="sessionID">ID of new session<param>
/// <param name="dict">config settings for new session</param></param>
/// <returns>true if session added succesfully, false if session already exists or is of wrong type</returns>
/// <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))
Expand All @@ -102,11 +102,11 @@ public bool AddSession(SessionID sessionID, Dictionary dict)
}

/// <summary>
/// Ad-hoc removal of an existing sssion
/// Ad-hoc removal of an existing session
/// </summary>
/// <param name="sessionID">ID of session to be removed</param>
/// <param name="terminateActiveSession">true if sesion to be removed even if it has an active connection</param>
/// <returns>true if session removed or was already not present, false if could not be removed because of active connection</returns>
/// <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;
Expand All @@ -130,7 +130,7 @@ public bool RemoveSession(SessionID sessionID, bool terminateActiveSession)
}
}
if (disconnectRequired)
session.Disconnect("Removed dynamically");
session.Disconnect("Dynamic session removal");
if (session != null)
session.Dispose();
return true;
Expand Down Expand Up @@ -233,9 +233,10 @@ protected virtual void OnConfigure(SessionSettings settings)
{ }

/// <summary>
/// Override this to handle ad-hoc session removal
/// 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 being remvoed</param>
/// <param name="sessionID">ID of session that was removed</param>
protected virtual void OnRemove(SessionID sessionID)
{ }

Expand Down
6 changes: 3 additions & 3 deletions QuickFIXn/IAcceptor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@ public interface IAcceptor
/// </summary>
/// <param name="sessionID">ID of session to be added</param>
/// <param name="dict">session settings</param>
/// <returns>>true if session added succesfully, false if session already exists or is of wrong type</returns>
/// <returns>>true if session added successfully, false if session already exists or is not an acceptor</returns>
bool AddSession(SessionID sessionID, QuickFix.Dictionary dict);

/// <summary>
/// Remove an existing session after acceptor has been started
/// </summary>
/// <param name="sessionID">ID of session to be removed</param>
/// <param name="terminateActiveSession">true if sesion to be removed even if it has an active connection</param>
/// <returns>true if session removed or was already not present, false if could not be removed because of active connection</returns>
/// <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>
bool RemoveSession(SessionID sessionID, bool terminateActiveSession);
}

Expand Down
6 changes: 3 additions & 3 deletions QuickFIXn/IInitiator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@ public interface IInitiator : IDisposable
/// </summary>
/// <param name="sessionID">ID of session to be added</param>
/// <param name="dict">session settings</param>
/// <returns>>true if session added succesfully, false if session already exists or is of wrong type</returns>
/// <returns>true if session added successfully, false if session already exists or is not an initiator</returns>
bool AddSession(SessionID sessionID, QuickFix.Dictionary dict);

/// <summary>
/// Remove an existing session after initiator has been started
/// </summary>
/// <param name="sessionID">ID of session to be removed</param>
/// <param name="terminateActiveSession">true if sesion to be removed even if it has an active connection</param>
/// <returns>true if session removed or was already not present, false if could not be removed because of active connection</returns>
/// <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>
bool RemoveSession(SessionID sessionID, bool terminateActiveSession);
}

Expand Down
2 changes: 1 addition & 1 deletion QuickFIXn/SessionSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ public void Set(QuickFix.Dictionary defaults)
/// <summary>
/// Remove existing session config from the settings
/// </summary>
/// <param name="sessionID">ID of session for which config to be removed</param>
/// <param name="sessionID">ID of session for which config is to be removed</param>
/// <returns>true if removed, false if config for the session does not exist</returns>
public bool Remove(SessionID sessionID)
{
Expand Down
10 changes: 5 additions & 5 deletions QuickFIXn/ThreadedSocketAcceptor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ private AcceptorSocketDescriptor GetAcceptorSocketDescriptor(Dictionary dict)
/// </summary>
/// <param name="sessionID">ID of new session<param>
/// <param name="dict">config settings for new session</param></param>
/// <returns>true if session added succesfully, false if session already exists or is of wrong type</returns>
/// <returns>true if session added successfully, false if session already exists or is not an acceptor</returns>
public bool AddSession(SessionID sessionID, Dictionary dict)
{
if (!sessions_.ContainsKey(sessionID))
Expand All @@ -169,19 +169,19 @@ public bool AddSession(SessionID sessionID, Dictionary dict)
}

/// <summary>
/// Ad-hoc removal of an existing sssion
/// Ad-hoc removal of an existing session
/// </summary>
/// <param name="sessionID">ID of session to be removed</param>
/// <param name="terminateActiveSession">true if sesion to be removed even if it has an active connection</param>
/// <returns>true if session removed or was already not present, false if could not be removed because of active connection</returns>
/// <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;
if (sessions_.TryGetValue(sessionID, out session))
{
if (session.IsLoggedOn && !terminateActiveSession)
return false;
session.Disconnect("Disabled via dynamic config update");
session.Disconnect("Dynamic session removal");
foreach (AcceptorSocketDescriptor descriptor in socketDescriptorForAddress_.Values)
if (descriptor.RemoveSession(sessionID))
break;
Expand Down
2 changes: 1 addition & 1 deletion QuickFIXn/Transport/SocketInitiator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ protected override void OnStart()
/// <summary>
/// Ad-hoc session removal
/// </summary>
/// <param name="sessionID">ID of session being remvoed</param>
/// <param name="sessionID">ID of session being removed</param>
protected override void OnRemove(SessionID sessionID)
{
sessionToHostNum_.Remove(sessionID);
Expand Down
10 changes: 5 additions & 5 deletions UnitTests/SessionDynamicTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ public void DynamicAcceptor()
string dynamicCompID = "acc10";
SendLogon(socket02, dynamicCompID);
Assert.IsTrue(WaitForDisconnect(socket02), "Server failed to disconnect unconfigured CompID");
Assert.False(HasReceivedMessage(dynamicCompID), "Unexpected messaage received for unconfigured CompID");
Assert.False(HasReceivedMessage(dynamicCompID), "Unexpected message received for unconfigured CompID");

// Add the dynamic acceptor and ensure that we can now log on
var sessionID = CreateSessionID(dynamicCompID);
Expand All @@ -343,12 +343,12 @@ public void DynamicAcceptor()
Assert.IsFalse(_acceptor.RemoveSession(sessionID, false), "Unexpected success removing active session");
Assert.IsTrue(socket03.Connected, "Unexpected loss of connection");

// Ensure that forced attempt to remove session dynamic sesison succeeds, even though it is in logged on state
// Ensure that forced attempt to remove session dynamic session succeeds, even though it is in logged on state
Assert.IsTrue(_acceptor.RemoveSession(sessionID, true), "Failed to remove active session");
Assert.IsTrue(WaitForDisconnect(socket03), "Socket still connected after session removed");
Assert.IsFalse(IsLoggedOn(dynamicCompID), "Session still logged on after being removed");

// Ensure that we can perform unforced removal of a dynamic sesion that is not logged on.
// Ensure that we can perform unforced removal of a dynamic session that is not logged on.
string dynamicCompID2 = "acc20";
var sessionID2 = CreateSessionID(dynamicCompID2);
Assert.IsTrue(_acceptor.AddSession(sessionID2, CreateSessionConfig(dynamicCompID2, false)), "Failed to add dynamic session to acceptor");
Expand Down Expand Up @@ -383,12 +383,12 @@ public void DynamicInitiator()
Assert.IsFalse(_initiator.RemoveSession(sessionID, false), "Unexpected success removing active session");
Assert.IsTrue(IsLoggedOn(dynamicCompID), "Unexpected logoff");

// Ensure that forced attempt to remove session dynamic sesison succeeds, even though it is in logged on state
// Ensure that forced attempt to remove session dynamic session succeeds, even though it is in logged on state
Assert.IsTrue(_initiator.RemoveSession(sessionID, true), "Failed to remove active session");
Assert.IsTrue(WaitForDisconnect(dynamicCompID), "Socket still connected after session removed");
Assert.IsFalse(IsLoggedOn(dynamicCompID), "Session still logged on after being removed");

// Ensure that we can perform unforced removal of a dynamic sesion that is not logged on.
// Ensure that we can perform unforced removal of a dynamic session that is not logged on.
string dynamicCompID2 = "ini20";
var sessionID2 = CreateSessionID(dynamicCompID2);
Assert.IsTrue(_initiator.AddSession(sessionID2, CreateSessionConfig(dynamicCompID2, true)), "Failed to add dynamic session to initiator");
Expand Down

0 comments on commit 5d17cc3

Please sign in to comment.