comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Ada x <whatever> Datagram Sockets
Date: Fri, 8 Feb 2019 21:31:45 +0100
Date: 2019-02-08T21:31:45+01:00	[thread overview]
Message-ID: <q3kovf$lf0$1@gioia.aioe.org> (raw)
In-Reply-To: d388a4c3-f16a-4e5f-9f9f-424de282a301@googlegroups.com

On 2019-02-08 20:41, Rego, P. wrote:
>> How is it controversial? The example works fine when the server and client
>> are both written in Ada, as they would then agree on the protocol.
>> But when dealing with cross-language communication, you're better off using
>> Send_Socket/Receive_Socket directly. No need to re-implement
> 
> I am trying this approach, but it seems that both g-socket.ads Send_Socket signatures also use Ada Streams
> 
>     procedure Receive_Socket
>       (Socket : Socket_Type;
>        Item   : out Ada.Streams.Stream_Element_Array;
>        Last   : out Ada.Streams.Stream_Element_Offset;
>        Flags  : Request_Flag_Type := No_Request_Flag);
> 
>     procedure Receive_Socket
>       (Socket : Socket_Type;
>        Item   : out Ada.Streams.Stream_Element_Array;
>        Last   : out Ada.Streams.Stream_Element_Offset;
>        From   : out Sock_Addr_Type;
>        Flags  : Request_Flag_Type := No_Request_Flag);

No. Stream_Element_Array is a plain array. Receive_Socket fill it and 
return the index of last updated element.

    declare
       Buffer : Stream_Element_Array (1..Max_Packet_Length);
       Last   : Stream_Element_Offset;
    begin
       Receive_Socket (Socket, Buffer, Last);
       -- Buffer (1..Last) is the receipt

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de


  reply	other threads:[~2019-02-08 20:31 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-06 23:10 Ada x <whatever> Datagram Sockets Rego, P.
2019-02-07  0:42 ` Jere
2019-02-07  5:28   ` Rego, P.
2019-02-07  6:00     ` Egil H H
2019-02-07  6:41       ` Rego, P.
2019-02-07  7:23         ` Egil H H
2019-02-07 11:48           ` Jere
2019-02-08 19:41           ` Rego, P.
2019-02-08 20:31             ` Dmitry A. Kazakov [this message]
2019-02-08 21:56               ` Rego, P.
2019-02-07  8:28         ` Dmitry A. Kazakov
2019-02-07 10:08           ` Simon Wright
2019-02-08  0:15           ` Randy Brukardt
2019-02-08  8:25             ` Simon Wright
2019-02-08 13:24               ` Dmitry A. Kazakov
2019-02-09  1:01               ` Randy Brukardt
2019-02-10 17:54                 ` Simon Wright
2019-02-11  8:39                   ` Dmitry A. Kazakov
2019-02-11 13:35                     ` Simon Wright
2019-02-11 14:25                       ` Dmitry A. Kazakov
2019-02-11 15:19                         ` Simon Wright
2019-02-11 16:04                           ` Dmitry A. Kazakov
2019-02-11 23:19                   ` Randy Brukardt
2019-02-12 11:35                     ` Simon Wright
2019-02-08 19:44           ` Rego, P.
2019-02-07 11:47         ` Jere
2019-02-07 18:00           ` Jeffrey R. Carter
2019-02-08 20:35             ` Rego, P.
2019-02-08 21:26               ` Jeffrey R. Carter
2019-02-08 22:02                 ` Rego, P.
2019-02-08 21:38               ` Dmitry A. Kazakov
2019-02-08 20:00           ` Rego, P.
2019-02-07 10:11     ` Simon Wright
2019-02-08 20:03       ` Rego, P.
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox