Skip to content

Commit

Permalink
Merge branch 'master' into stopstart_48
Browse files Browse the repository at this point in the history
  • Loading branch information
gbirchmeier committed May 8, 2013
2 parents 9138072 + 59ad0ea commit e696ce8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 25 deletions.
13 changes: 4 additions & 9 deletions QuickFIXn/ThreadedSocketAcceptor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@ public Dictionary<SessionID, Session> GetAcceptedSessions()
}
}

private SessionSettings settings_;
private SessionFactory sessionFactory_;
private Dictionary<SessionID, Session> sessions_ = new Dictionary<SessionID, Session>();
private Dictionary<IPEndPoint, AcceptorSocketDescriptor> socketDescriptorForAddress_ = new Dictionary<IPEndPoint, AcceptorSocketDescriptor>();
private bool isStarted_ = false;
Expand All @@ -76,12 +74,9 @@ public ThreadedSocketAcceptor(IApplication application, IMessageStoreFactory sto

public ThreadedSocketAcceptor(SessionFactory sessionFactory, SessionSettings settings)
{
settings_ = settings;
sessionFactory_ = sessionFactory;

try
{
CreateSessions(settings_);
CreateSessions(settings, sessionFactory);
}
catch (System.Exception e)
{
Expand All @@ -93,7 +88,7 @@ public ThreadedSocketAcceptor(SessionFactory sessionFactory, SessionSettings set

#region Private Methods

private void CreateSessions(SessionSettings settings)
private void CreateSessions(SessionSettings settings, SessionFactory sessionFactory)
{
foreach (SessionID sessionID in settings.GetSessions())
{
Expand All @@ -103,7 +98,7 @@ private void CreateSessions(SessionSettings settings)
if ("acceptor".Equals(connectionType))
{
AcceptorSocketDescriptor descriptor = GetAcceptorSocketDescriptor(settings, sessionID);
Session session = sessionFactory_.Create(sessionID, dict);
Session session = sessionFactory.Create(sessionID, dict);
descriptor.AcceptSession(session);
sessions_[sessionID] = session;
}
Expand All @@ -115,7 +110,7 @@ private void CreateSessions(SessionSettings settings)

private AcceptorSocketDescriptor GetAcceptorSocketDescriptor(SessionSettings settings, SessionID sessionID)
{
QuickFix.Dictionary dict = settings_.Get(sessionID);
QuickFix.Dictionary dict = settings.Get(sessionID);
int port = System.Convert.ToInt32(dict.GetLong(SessionSettings.SOCKET_ACCEPT_PORT));
SocketSettings socketSettings = new SocketSettings();

Expand Down
18 changes: 2 additions & 16 deletions QuickFIXn/Transport/SocketInitiator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@ public bool Connected

#region Private Members

private IApplication app_;
private SessionSettings settings_;
private IMessageStoreFactory storeFactory_;
private ILogFactory logFactory_;
private Socket socket_ = null;
private byte[] _readBuffer = new byte[512];
private volatile bool shutdownRequested_ = false;
Expand All @@ -58,21 +54,11 @@ public SocketInitiator(IApplication application, IMessageStoreFactory storeFacto

public SocketInitiator(IApplication application, IMessageStoreFactory storeFactory, SessionSettings settings, ILogFactory logFactory)
: base(application, storeFactory, settings, logFactory)
{
app_ = application;
storeFactory_ = storeFactory;
settings_ = settings;
logFactory_ = logFactory;
}
{ }

public SocketInitiator(IApplication application, IMessageStoreFactory storeFactory, SessionSettings settings, ILogFactory logFactory, IMessageFactory messageFactory)
: base(application, storeFactory, settings, logFactory, messageFactory)
{
app_ = application;
storeFactory_ = storeFactory;
settings_ = settings;
logFactory_ = logFactory;
}
{ }

public static void SocketInitiatorThreadStart(object socketInitiatorThread)
{
Expand Down

0 comments on commit e696ce8

Please sign in to comment.