Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Simple functions to run TCP clients and servers.
Synopsis
- runTCPClient :: HostName -> ServiceName -> (Socket -> IO a) -> IO a
- runTCPServer :: Maybe HostName -> ServiceName -> (Socket -> IO a) -> IO a
- runTCPServerWithSocket :: (AddrInfo -> IO Socket) -> Maybe HostName -> ServiceName -> (Socket -> IO a) -> IO a
- openServerSocket :: AddrInfo -> IO Socket
Documentation
runTCPClient :: HostName -> ServiceName -> (Socket -> IO a) -> IO a Source #
Running a TCP client with a connected socket.
runTCPServer :: Maybe HostName -> ServiceName -> (Socket -> IO a) -> IO a Source #
Running a TCP server with an accepted socket and its peer name.
Generalized API
runTCPServerWithSocket Source #
:: (AddrInfo -> IO Socket) | Initialize socket. This function is called while exceptions are masked. The default (used by |
-> Maybe HostName | |
-> ServiceName | |
-> (Socket -> IO a) | Called for each incoming connection, in a new thread |
-> IO a |
Generalization of runTCPServer