Safe Haskell | None |
---|---|
Language | Haskell98 |
- data Socket
- sockRemoteHost :: Socket -> IP4
- sockRemotePort :: Socket -> TcpPort
- sockLocalPort :: Socket -> TcpPort
- connect :: TcpHandle -> IP4 -> TcpPort -> Maybe TcpPort -> IO Socket
- data ConnectError = ConnectionRefused
- listen :: TcpHandle -> IP4 -> TcpPort -> IO Socket
- data ListenError = ListenError
- accept :: Socket -> IO Socket
- data AcceptError = AcceptError
- close :: Socket -> IO ()
- data CloseError = CloseError
- sendBytes :: Socket -> ByteString -> IO Int64
- canSend :: Socket -> IO Bool
- recvBytes :: Socket -> Int64 -> IO ByteString
- canRecv :: Socket -> IO Bool
Documentation
sockRemoteHost :: Socket -> IP4 Source
The remote host of a socket.
sockRemotePort :: Socket -> TcpPort Source
The remote port of a socket.
sockLocalPort :: Socket -> TcpPort Source
The local port of a socket.
connect :: TcpHandle -> IP4 -> TcpPort -> Maybe TcpPort -> IO Socket Source
Connect to a remote host.
data ConnectError Source
A connect call failed.
listen :: TcpHandle -> IP4 -> TcpPort -> IO Socket Source
Open a new listening socket that can be used to accept new connections.
sendBytes :: Socket -> ByteString -> IO Int64 Source
Send bytes over a socket. The number of bytes delivered will be returned, with 0 representing the other side having closed the connection.