Next: Building a DSA application with PolyORB, Previous: Installing DSA application personality, Up: DSA
In this section we will write a really simple client-server application
using PolyORB DSA. The server will provide a Remote Call Interface
composed of a single Echo_String
function that will take a String
and return it to the caller.
Here is the code for the server:
server.ads:
package Server is pragma Remote_Call_Interface; function Echo_String (S : String) return String; end Server;
server.adb:
package body Server is function Echo_String (S : String) return String is begin return S; end Echo_String; end Server;
And here is the code for the client:
client.adb:
with Ada.Text_IO; use Ada.Text_IO; with Server; procedure Client is begin Put_Line ("The client has started!"); Put ("Thus spake my server upon me:"); Put_Line (Server.Echo_String ("Hi!")); end Client;
For more details about the distributed system annex please report yourself to the Ada 95 Reference Manual [ISO95].