[Haskell-cafe] ANN: network-socket-options 0.1

Joey Adams joeyadams3.14159 at gmail.com
Wed Feb 22 02:30:48 CET 2012


On Tue, Feb 21, 2012 at 7:36 PM, Conrad Parker <conrad at metadecks.org> wrote:
> awesome! I've prepared some patches for network to add this module and
> its tests, in this branch:
>
> https://github.com/kfish/network/tree/options

Cool, thanks!

> I didn't modify any other modules, perhaps Network.Socket.Options
> should be re-exported from Network.Socket, and perhaps
> {get,set}SocketOption should be deprecated?

I agree with deprecating getSocketOption and setSocketOption.  Don't
remove them, just deprecate them.  Network.Socket.Options doesn't
implement all of the options {get,set}SocketOption has, yet (e.g.
RecvLowWater).

I'm not sure about re-exporting Network.Socket.Options, though.
That's a lot to dump into the namespace.  Particularly worrisome names
include:

    * getError

    * getType

Note the following:

 * I'm going to release network-socket-options 0.1.1 pretty soon.  It
will add higher-level functions for setting socket timeouts, to work
around the lack of a proper IO manager for Windows:

        http://trac.haskell.org/network/ticket/2
        http://trac.haskell.org/network/ticket/31#comment:1

 * Network.Socket has a getPeerCred function, which gets the
SO_PEERCRED socket option.  Perhaps it should be moved to
Network.Socket.Options (re-exported in Network.Socket for backward
compatibility) and generalized with HasSocket like the other options.

 * A couple of the tests in my test suite require root access.
Consider them optional, as they cover ground already pretty
well-covered by the other tests.

Thanks for the integration work.

-Joey



More information about the Haskell-Cafe mailing list