On 4/7/07, ROBERT DOUGLAS HOELZ <[EMAIL PROTECTED]> wrote:
Is Network.Socket buggy/incomplete? I'm trying to implement an NNTP module in Haskell, but it seems the Network.Socket module doesn't convert the native byte order to network byte order, so the connection gets denied. When I reverse the bytes in the address by hand and try to connect, it locks up. What's wrong?
There was a discussion on it: http://www.mail-archive.com/[email protected]/msg11292.html One answer (use Network.Socket.inet_addr) works, but isn't very satisfactory. Another recommendation pulls the htons(), et al. functions into Haskell using FFI. This is better, but more initial work. But I believe both answers aren't correct. The binary serialization module should replace 99% of the need of htonl(), etc. For socket addresses, the Network library needs to do the endianness conversion, like the PortNum type does. -- Rich AIM : rnezzy ICQ : 174908475 Jabber: [EMAIL PROTECTED] _______________________________________________ Haskell mailing list [email protected] http://www.haskell.org/mailman/listinfo/haskell
