Socket Options

Peter Simons simons at cryp.to
Fri Jun 25 20:40:12 EDT 2004


Hi,

the Network module provides the data type SocketOption. I am
particularly interested in setting the RecvTimeOut and
SendTimeOut values, but I wonder how to set them. The
function

  setSocketOption :: Socket -> SocketOption -> Int -> IO ()

allows me only 'Int' parameters, but the kernel expects a
struct timeval here -- or more accurately, a pointer to one.
Do I really have to engage in FFI pointer wizardry here, or
is there a simpler way to set these values?

Am I even supposed to set them, or is there a better way to
specify general I/O timeouts than on the socket level?

Peter



More information about the Glasgow-haskell-users mailing list