Skip to content

Timeout socket options are unusable #8

@bmillwood

Description

@bmillwood

The setSockOpt API only allows setting options that take a CInt, but the RecvTimeOut option (for example) translates to SO_RCVTIMEO which expects a struct timeval. In my opinion it doesn't make any sense to mirror the underlying setsockopt C function with just one Haskell function; getsockopt is just as bad.

The underlying foreign import has a Ptr CInt argument, but the C function uses void*, so a Ptr a would probably be more appropriate. But this doesn't make a great deal of difference since it's not exported anyway.

While I'm here, does it really make sense to have an API that changes based on which computer it's compiled on? It's not a very helpful error message.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions