From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22094 invoked by alias); 1 Mar 2003 08:06:00 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 22080 invoked by uid 71); 1 Mar 2003 08:06:00 -0000 Date: Sat, 01 Mar 2003 08:06:00 -0000 Message-ID: <20030301080600.22079.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Simon Wright Subject: Re: ada/9535: Datagram socket semantics are wrong Reply-To: Simon Wright X-SW-Source: 2003-03/txt/msg00012.txt.bz2 List-Id: The following reply was made to PR ada/9535; it has been noted by GNATS. From: Simon Wright To: gcc-gnats@gcc.gnu.org, gcc-bugs@gcc.gnu.org, nobody@gcc.gnu.org, simon@pushface.org, gcc-prs@gcc.gnu.org Cc: Subject: Re: ada/9535: Datagram socket semantics are wrong Date: Sat, 01 Mar 2003 07:57:02 +0000 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=9535 A clarification (I hope): At present, you can't use 'Read, 'Write with Stream(UDP_Socket) at all (except for elementary types). You can Write a Stream_Element_Array, but you can't Read one unless you know beforehand how big it needs to be. The patch I sent allows you to Read into an arbitrarily-sized Stream_Element_Array, but you still can't do 'Read, 'Write directly. It's at least arguable that users should not be able to get a Stream at all for a UDP socket (use Receive_Socket, Send_Socket instead). That solution would cause us problems on the writing side: to avoid multiple OS calls, we get the user to stream his data into a memory stream get the user to write the contents of the memory stream to your socket's stream in one go. On the UDP read side (using unpatched GNAT), we Receive_Socket into a memory stream give the user our memory stream to read from rather than your socket's stream.