Safe Haskell | None |
---|---|
Language | Haskell2010 |
A thin wrapper of the Network.Socket API.
Synopsis
- data Socket
- resolve :: HostName -> PortNumber -> IO [InetAddr]
- open :: Milliseconds -> InetAddr -> Maybe SSLContext -> IO Socket
- send :: Socket -> ByteString -> IO ()
- recv :: Int -> InetAddr -> Socket -> Int -> IO ByteString
- close :: Socket -> IO ()
- shutdown :: Socket -> ShutdownCmd -> IO ()
- type HostName = String
- data PortNumber
- data ShutdownCmd
Documentation
open :: Milliseconds -> InetAddr -> Maybe SSLContext -> IO Socket Source #
Either a host name e.g., "haskell.org"
or a numeric host
address string consisting of a dotted decimal IPv4 address or an
IPv6 address e.g., "192.168.0.1"
.
data PortNumber #
Port number.
Use the Num
instance (i.e. use a literal) to create a
PortNumber
value.
>>>
1 :: PortNumber
1>>>
read "1" :: PortNumber
1>>>
show (12345 :: PortNumber)
"12345">>>
50000 < (51000 :: PortNumber)
True>>>
50000 < (52000 :: PortNumber)
True>>>
50000 + (10000 :: PortNumber)
60000