procedure Run(Address : access Sockets.Sock_Addr_Type) is
Term_Address : Sockets.Sock_Addr_Type := Address.all;
Socket : Sockets.Socket_Type;
Channel : Sockets.Stream_access;
Command, Response : String_Access;
Status : Boolean := False;
begin
Term_Address.Port := 5876;
Sockets.Create_Socket (Socket);
Sockets.Set_Socket_Option
(Socket,
Sockets.Socket_Level,
(Sockets.Reuse_Address, True));
delay 0.2;
Sockets.Connect_Socket (Socket, Term_Address);
Channel := Sockets.stream(Socket);
loop
Response := new String ' (String'Input(Channel));
Print(Response.all, 0.02, False);
Command := new String ' (Text_Io.Get_Line);
String'Output(Channel, Command.all);
Status := Boolean'Input(Channel);
case Status is
when True =>
null;
when False =>
null;
end case;
end loop;
end Run;