コードには、サーバーが接続されているかどうかを確認するタイマーがあります。接続されていない場合は、サーバーへの再接続を試みます。
コードは以下の通りです
private void timer_Elapsed(object source, ElapsedEventArgs e)
{
timer.Stop();
if (timer.Interval != serverTimeOut)
{
timer.Interval = serverTimeOut;
}
timer.Start();
//below the code to check whether server connected or not
}
次のような例外が発生しています
Class: System.Threading.TimerBase
Function: DeleteTimerNative
Exception: System.ApplicationException: Error in the application.
at System.Threading.TimerBase.DeleteTimerNative(SafeHandle notifyObject)
at System.Threading.TimerBase.Dispose()
at System.Threading.Timer.Dispose()
at System.Timers.Timer.set_Enabled(Boolean value)
at System.Timers.Timer.Stop()
at ServerConnection.timer_Elapsed(Object source, ElapsedEventArgs e)
経過イベントでは、タイマーを停止して間隔を変更し、再びタイマーを開始します。この手順で例外が発生しますか?