private void OnReconnect(object state)
{
try
{
// check for exit.
if (m_reconnectTimer == null)
{
return;
}
// do the reconnect.
if (DoReconnect())
{
lock (m_lock)
{
if (m_reconnectTimer != null)
{
m_reconnectTimer.Dispose();
m_reconnectTimer = null;
}
}
// notify the caller.
m_callback(this, null);
}
}
catch (Exception exception)
{
Utils.Trace(exception, "Unexpected error during reconnect.");
}
}