Proposal: ByteString based datagram communication (Ticket #1238 )

Robert Marlow rob at
Thu Apr 5 05:14:25 EDT 2007

Hi all

I'm back and am keen to work on getting this patch accepted.

Concerns I've so far seen raised include

1. bos: It breaks the existing stable API
   I need more information on this; I can't see what's broken unless the
   change of sendTo and recvFrom to datagram functions is what is
   considered broken. I'd argue the current sendTo and recvFrom 
   functions are what is broken in terms of usefulness and how their 
   functionality fits their names. This patch fixes that.

2. bos: It restricts to AF_INET
   As far as my testing has shown it should also work with AF_UNIX. To 
   get it working with AF_UNIX the patch also includes a bugfix in 
   Network.Socket. As such, the patch should hopefully reduce the 
   current AF_INET restriction.

3. dons: Similar work has been done on HAppS and HaskellNet
   I'm keen to integrate any ideas from these platforms. I'm discussing
   it with S. Alexander Jacobson. If anyone can outline some good ideas
   from these platforms that should be included in the patch I'll gladly
   look into it. However, It's meant to be a simple change to make 
   sendTo and recvFrom act as expected of network utilities with those 
   names while providing convenient and efficient datagram utilities 
   similar to what exists for stream based connections rather than add 
   too many features.

4. me: It's not tested as well as I'd like
   I'm having trouble testing with hugs. runhugs -98 ./Setup.hs build 
   returns 'ERROR "dist/build/Network/BSD.hs" - Can't find imported
module "GHC.IOBase"'. Something screwy with hsc2hs or cpphs?
   I don't have windows so still haven't tested that. Can any Windows 
   users help please?

On Wed, 2007-03-21 at 00:17 +0900, Robert Marlow wrote: 
> I've made a proposal to add ByteString based datagram communication to
> Network.Socket and Network. Details are at:
> I rushed to get this done before I go on a trip tomorrow so I haven't
> completed testing and won't be available to discuss it for the next 9
> days. As such, if discussion is needed, an extended deadline would be
> appreciated.
> Testing windows is a bit awkward for me since I don't have a windows
> machine, so if anyone can test that platform I'd be very appreciative.
> I'll try to work through the problems I was having with hugs and test
> when I get back unless someone else wants to test it first.
> Thanks.

Robert Marlow
MITS Co-operative Limited

More information about the Libraries mailing list