Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Simple functions to run TCP clients and servers.
Synopsis
- runTCPServer :: Int -> Maybe HostName -> ServiceName -> TimeoutServer a -> IO a
- type TimeoutServer a = Manager -> Handle -> Socket -> IO a
- runTCPServerWithSocket :: (AddrInfo -> IO Socket) -> Int -> Maybe HostName -> ServiceName -> TimeoutServer a -> IO a
- openClientSocket :: AddrInfo -> IO Socket
- openServerSocket :: AddrInfo -> IO Socket
Documentation
:: Int | Timeout in second. |
-> Maybe HostName | |
-> ServiceName | |
-> TimeoutServer a | |
-> IO a |
Running a TCP server with an accepted socket and its peer name.
type TimeoutServer a Source #
= Manager | A global timeout manager |
-> Handle | A thread-local timeout handler |
-> Socket | A connected socket |
-> IO a |
A server type
Generalized API
runTCPServerWithSocket Source #
:: (AddrInfo -> IO Socket) | |
-> Int | Timeout in second. |
-> Maybe HostName | |
-> ServiceName | |
-> TimeoutServer a | |
-> IO a |
Generalization of runTCPServer
See runTCPServerWithSocket
for additional discussion.