This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: ada/9535: Datagram socket semantics are wrong
- From: Simon Wright <simon at pushface dot org>
- To: gcc-gnats at gcc dot gnu dot org, gcc-bugs at gcc dot gnu dot org, nobody at gcc dot gnu dot org, simon at pushface dot org, gcc-prs at gcc dot gnu dot org
- Date: Sat, 01 Mar 2003 07:57:02 +0000
- Subject: Re: ada/9535: Datagram socket semantics are wrong
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.