public void DoSend(string locationSemantic, IEnvelope message, int timeout)
{
var timer = new Timer(timeout * 1000);
m_location = locationSemantic;
try
{
_is_completed = false;
timer.Elapsed += Timer_Elasped;
timer.Start();
this.DoSend(locationSemantic, message);
_is_completed = true;
timer.Stop();
}
catch (Exception exception)
{
timer.Stop();
throw;
}
finally
{
if (timer.Enabled)
timer.Stop();
timer.Elapsed -= Timer_Elasped;
timer.Dispose();
}
}