On Mon, Aug 24, 2009 at 12:48 PM, Johan Tibell <johan.tibell@gmail.com> wrote:
My plan for network-bytestring has always been to offer a
Network.Socket.Buffer with function such as 'recvInto' that work on
buffers. The higher level bytestring interface can then be implemented
in terms of this interface.
How would a Buffer differ from a combination of Ptr a and CSize? (My implied argument is that it shouldn't.)
I've been struggling a bit with how to expose less frequently used
functionality in the BSD socket API such as the 'flags' parameter to
'send'. It feels a bit unfortunate to have to pass a "no flags" value
in the most frequent case. Optional keyword parameters would be useful
here.
send vs sendWithFlags would be workable, since we're not going to get keyword or optional arguments in a happy-making form in the language any time soon. Of course, just making people use defaultFlags (as getAddrInfo does) isn't too awful, either.