protected void Connect() { lock (sync_) { HashSet <SessionID> disconnectedSessions = new HashSet <SessionID>(disconnected_); foreach (SessionID sessionID in disconnectedSessions) { Session session = Session.LookupSession(sessionID); if (session.IsEnabled) { if (session.IsNewSession) { session.Reset("New session"); } if (session.IsSessionTime) { DoConnect(sessionID, _settings.Get(sessionID)); } } } } }
protected void Connect() { lock (GdaxPrototyping.Common.Core.Threading.TThreadingHelpers.MainLockable) { HashSet <SessionID> disconnectedSessions = new HashSet <SessionID>(disconnected_); foreach (SessionID sessionID in disconnectedSessions) { Session session = Session.LookupSession(sessionID); if (session.IsEnabled) { if (session.IsNewSession) { session.Reset("New session"); } if (session.IsSessionTime) { DoConnect(sessionID, _settings.Get(sessionID)); } } } } }