Skip to content

Commit

Permalink
fixing doc
Browse files Browse the repository at this point in the history
  • Loading branch information
kazu-yamamoto committed Mar 24, 2023
1 parent 78696e9 commit df11dab
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions Network/Socket/Options.hsc
Original file line number Diff line number Diff line change
Expand Up @@ -353,8 +353,7 @@ whenSupported s action
| isSupportedSocketOption s = action >> return ()
| otherwise = return ()

-- | Set a socket option that expects an Int value.
-- There is currently no API to set e.g. the timeval socket options
-- | Set a socket option that expects an 'Int' value.
setSocketOption :: Socket
-> SocketOption -- Option Name
-> Int -- Option Value
Expand All @@ -379,8 +378,7 @@ setSockOpt s (SockOpt level opt) v = do
throwSocketErrorIfMinus1_ "Network.Socket.setSockOpt" $
c_setsockopt fd level opt ptr sz

-- | Get a socket option that gives an Int value.
-- There is currently no API to get e.g. the timeval socket options
-- | Get a socket option that gives an 'Int' value.
getSocketOption :: Socket
-> SocketOption -- Option Name
-> IO Int -- Option Value
Expand All @@ -396,8 +394,8 @@ getSocketOption s so = do
-- | Get a socket option.
getSockOpt :: forall a . Storable a
=> Socket
-> SocketOption -- Option Name
-> IO a -- Option Value
-> SocketOption -- Option Name
-> IO a -- Option Value
getSockOpt s (SockOpt level opt) = do
alloca $ \ptr -> do
let sz = fromIntegral $ sizeOf (undefined :: a)
Expand Down

0 comments on commit df11dab

Please sign in to comment.