Created
September 20, 2012 07:57
-
-
Save ThomasLocke/3754529 to your computer and use it in GitHub Desktop.
Ada tasking and timeouts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
task body AMI_Action | |
is | |
begin | |
select | |
accept Start do | |
select | |
delay 2.0; | |
raise AMI_Action_Error with Connect_Timed_Out_Message; | |
then abort | |
AWS.Net.Std.Connect (Socket => Action_Socket, | |
Host => Config.Get (PBX_Host), | |
Port => Config.Get (PBX_Port)); | |
end select; | |
end Start; | |
or | |
delay 3.0; | |
raise AMI_Action_Error with No_Call_On_Start_Received; | |
end select; | |
loop | |
-- Mad socket action! | |
end loop; | |
exception | |
-- Catch exceptions, log issue and complete. | |
end AMI_Action; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment