/// <summary> /// Terminate Connection from Simulated Exchange /// </summary> /// <returns></returns> public bool Stop() { try { // Publish Logout Message to Simulated Exchange _communicationController.PublishOrderAdminMessage("OrderLogout"); _isConnected = false; if (LogoutArrived != null) { LogoutArrived.Invoke(Common.Core.Constants.OrderExecutionProvider.SimulatedExchange); } // Clear cancel orders map _cancelOrdersMap.Clear(); // Disconncet Communnication Controller _communicationController.Disconnect(); return(_isConnected); } catch (Exception exception) { Logger.Error(exception, _type.FullName, "Stop"); return(false); } }
/// <summary> /// Disconnect/Stops a client /// </summary> public bool Stop() { try { if (Logger.IsInfoEnabled) { Logger.Info("Stoping Simulated Exchange Connector", _type.FullName, "Stop"); } _isConnected = false; _communicationController.Disconnect(); if (LogoutArrived != null) { LogoutArrived.Invoke(Common.Core.Constants.MarketDataProvider.SimulatedExchange); } return(true); } catch (Exception exception) { Logger.Error(exception, _type.FullName, "Stop"); return(false); } }