Socket Options
Martin Sjögren
md9ms at mdstud.chalmers.se
Mon Jun 28 08:08:29 EDT 2004
mån 2004-06-28 klockan 14.00 skrev Peter Simons:
> Simon Marlow writes:
>
> > I'm tempted to replace the current setSocketOption with
> > this version. Would anyone object?
>
> On the contrary. IMHO, the SockOption type should be
> extended to contain the required parameter, for example:
>
> data SocketOption
> = Debug Bool
> | ReuseAddr Bool
> | SendBuffer (Maybe Int) -- bytes
> | RecvTimeOut (Maybe Int) -- milliseconds
> | SendTimeOut (Maybe Int)
> | [...]
>
> Then setSocketOption would even add the type-safety which
> the original function call doesn't have, and it would be
> more intuitive to use.
Wouldn't that make
getSocketOption :: Socket -> SocketOption -> IO Int
a bit strange? How would you propose to change it?
/Martin
--
Martin Sjögren <md9ms at mdstud.chalmers.se>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Detta =?ISO-8859-1?Q?=E4r?= en digitalt signerad
meddelandedel
Url : http://www.haskell.org//pipermail/glasgow-haskell-users/attachments/20040628/9d8494ba/attachment.bin
More information about the Glasgow-haskell-users
mailing list