-- Second_Echo_String - Provide a trivial UDP echo server from a fixed port. -- Copyright (C) 2022,2023 Prince Trippy . -- This program is free software: you can redistribute it and/or modify it under the terms of the -- GNU Affero General Public License version 3 as published by the Free Software Foundation. -- This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without -- even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -- See the GNU Affero General Public License for more details. -- You should have received a copy of the GNU Affero General Public License along with this program. -- If not, see . with Usable_Datagram_Package; use Usable_Datagram_Package; -- Compare this to the Echo preceding it. procedure Second_Echo_String is A : Address; P : Port; D : String(1 .. 512); I : Integer; S : System_Resource(Where => 7); begin loop begin Get(S, Data => D, From => A, From_Port => P, Length => I); I := Integer'Min(I, D'Length); -- This is the one minor inconvenience of the latest design. Hit(S, Data => D(1 .. I), To => A, At_Port => P); -- This handles, nicely, the zero length. exception when others => null; end; end loop; end Second_Echo_String; .