private void HandleSessionEvent(Object sender, SessionEventArgs args) { var sessionEvent = args.Event; string logMessage = string.Format("Solace Session Event Received: '{0}'; details: '{1}'", args.Event, args.Info); switch (sessionEvent) { case SessionEvent.ConnectFailedError: case SessionEvent.DownError: log.Warn(logMessage); _state = CommunicationState.Faulted; // We need to shutdown _parent.Stop(); break; case SessionEvent.UpNotice: _state = CommunicationState.Opened; break; case SessionEvent.MessageTooBigError: case SessionEvent.RejectedMessageError: log.Warn(logMessage); break; case SessionEvent.Acknowledgement: break; default: break; } }
public static void Main(string[] args) { // Load the config var config = ConfigurationManager.GetSection("MatchingEngineConfiguration") as ServiceConfiguration; // Allow to debug this service through Visual Studio or run it from // a command line. MatchingEngine service = new MatchingEngine(config); service.OnStart(null); while (true) { Thread.Sleep(50); } service.Stop(); }