Maintainer | joeyadams3.14159@gmail.com |
---|---|
Safe Haskell | Safe-Infered |
Documentation is currently lacking. For now, see man 7 socket
and
man 7 tcp
of the Linux man-pages, or look up setsockopt in MSDN.
- getAcceptConn :: HasSocket sock => sock -> IO Bool
- getBroadcast :: HasSocket sock => sock -> IO Bool
- getDebug :: HasSocket sock => sock -> IO Bool
- getDontRoute :: HasSocket sock => sock -> IO Bool
- getError :: HasSocket sock => sock -> IO Int
- getKeepAlive :: HasSocket sock => sock -> IO Bool
- getLinger :: HasSocket sock => sock -> IO (Maybe Seconds)
- getOOBInline :: HasSocket sock => sock -> IO Bool
- getRecvBuf :: HasSocket sock => sock -> IO Int
- getRecvTimeout :: HasSocket sock => sock -> IO Microseconds
- getReuseAddr :: HasSocket sock => sock -> IO Bool
- getSendBuf :: HasSocket sock => sock -> IO Int
- getSendTimeout :: HasSocket sock => sock -> IO Microseconds
- getType :: HasSocket sock => sock -> IO SocketType
- getTcpNoDelay :: HasSocket sock => sock -> IO Bool
- setBroadcast :: HasSocket sock => sock -> Bool -> IO ()
- setDebug :: HasSocket sock => sock -> Bool -> IO ()
- setDontRoute :: HasSocket sock => sock -> Bool -> IO ()
- setKeepAlive :: HasSocket sock => sock -> Bool -> IO ()
- setLinger :: HasSocket sock => sock -> Maybe Seconds -> IO ()
- setOOBInline :: HasSocket sock => sock -> Bool -> IO ()
- setRecvBuf :: HasSocket sock => sock -> Int -> IO ()
- setRecvTimeout :: HasSocket sock => sock -> Microseconds -> IO ()
- setReuseAddr :: HasSocket sock => sock -> Bool -> IO ()
- setSendBuf :: HasSocket sock => sock -> Int -> IO ()
- setSendTimeout :: HasSocket sock => sock -> Microseconds -> IO ()
- setTcpNoDelay :: HasSocket sock => sock -> Bool -> IO ()
- class HasSocket a where
- type Seconds = Int
- type Microseconds = Int64
Getting options
getAcceptConn :: HasSocket sock => sock -> IO BoolSource
This option is get-only.
getBroadcast :: HasSocket sock => sock -> IO BoolSource
getDontRoute :: HasSocket sock => sock -> IO BoolSource
getKeepAlive :: HasSocket sock => sock -> IO BoolSource
getOOBInline :: HasSocket sock => sock -> IO BoolSource
getRecvBuf :: HasSocket sock => sock -> IO IntSource
getRecvTimeout :: HasSocket sock => sock -> IO MicrosecondsSource
getReuseAddr :: HasSocket sock => sock -> IO BoolSource
getSendBuf :: HasSocket sock => sock -> IO IntSource
getSendTimeout :: HasSocket sock => sock -> IO MicrosecondsSource
getType :: HasSocket sock => sock -> IO SocketTypeSource
This option is get-only.
TCP
getTcpNoDelay :: HasSocket sock => sock -> IO BoolSource
Setting options
setLinger :: HasSocket sock => sock -> Maybe Seconds -> IO ()Source
On Windows, the Seconds
value is truncated to 16 bits. This means if a
linger time of more than 65535 seconds (about 18.2 hours) is given, it will
wrap around.
setRecvTimeout :: HasSocket sock => sock -> Microseconds -> IO ()Source
Note the following about timeout values:
- A value of 0 or less means the operation will never time out
- On Windows, the timeout is truncated to milliseconds, 32-bit. However, if the number of microseconds is from 1 to 999, it will be rounded up to one millisecond, to prevent it from being treated as "never time out".
setSendTimeout :: HasSocket sock => sock -> Microseconds -> IO ()Source
TCP
Types
type Microseconds = Int64Source