This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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.




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]