RosettaCodeData/Task/Sockets/Ada/sockets.ada

15 lines
450 B
Ada
Raw Permalink Normal View History

2013-04-11 01:07:29 -07:00
with GNAT.Sockets; use GNAT.Sockets;
2016-12-05 22:15:40 +01:00
procedure Socket_Send is
Client : Socket_Type;
2013-04-11 01:07:29 -07:00
begin
Initialize;
2016-12-05 22:15:40 +01:00
Create_Socket (Socket => Client);
Connect_Socket (Socket => Client,
Server => (Family => Family_Inet,
Addr => Inet_Addr ("127.0.0.1"),
Port => 256));
String'Write (Stream (Client), "hello socket world");
Close_Socket (Client);
end Socket_Send;