public bool TryRegister(string exchangeCode, string sessionId, IStateServer stateServer, out ExchangeSystem exchangeSystem) { exchangeSystem = null; if (this._ExchangeSystems.TryGetValue(exchangeCode, out exchangeSystem)) { exchangeSystem.Replace(sessionId, stateServer); } else { Logger.AddEvent(TraceEventType.Error, "ExchangeManager.Register Invalid exchangeCode:" + exchangeCode); } return exchangeSystem != null; }
public void Replace(string sessionId, IStateServer stateServer) { this._SessionId = sessionId; this._StateServer = stateServer; this.ConnectionState = ConnectionState.Connected; this._QuotationServer.SetStateServer(stateServer); this._QuotationRelayEngine.Resume(); Logger.AddEvent(TraceEventType.Information, "ExchangeCode:{0},Connection to StateSever established. sessionId:{1}", ExchangeCode, this._SessionId); }
public void Replace(string sessionId, IStateServer stateServer) { this._SessionId = sessionId; this._StateServer = stateServer; this._ConnectionState = ConnectionState.Connected; }