Skip to content

Instantly share code, notes, and snippets.

@ThomasLocke
Created September 20, 2012 07:57
Show Gist options
  • Save ThomasLocke/3754529 to your computer and use it in GitHub Desktop.
Save ThomasLocke/3754529 to your computer and use it in GitHub Desktop.
Ada tasking and timeouts
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