protected override void OnHandleDestroyed(EventArgs e) { base.OnHandleDestroyed(e); _process.Kill(); _inServer.Dispose(); _outServer.Dispose(); }
private void OnDestroy() { if (_outServer != null) { _outServer.Dispose(); } if (_inServer != null) { _inServer.Dispose(); } }
//shut down by timer, in case of client crash/hang private void _exitTimer_Tick(object sender, EventArgs e) { try { log.Info("Exiting by timer,timeout:" + _exitTimer.Interval); log.Info("==============SHUTTING DOWN=========="); _mainWorker.Shutdown(); _memServer.Dispose(); _inCommServer.Dispose(); _outCommServer.Dispose(); IsRunning = false; } catch (Exception ex) { log.Info("Exception on shutdown:" + ex.StackTrace); } }