Simple functions to run network clients and servers.
Changes
Revision history for network-run
0.6.0
Fixing a bug that the [(SocketOption, Int)] variants
(openClientSocketWithOptions, openServerSocketWithOptions and
openTCPServerSocketWithOptions) passed an Int, that is eight
bytes, to setsockopt. BSD rejects this with EINVAL, so the
documented (IPv6Only, 0) for a dual stack socket did not work
there. The value is converted to CInt now.
A test suite.
Breaking change: Network.Run.TCP.Timeout no longer exports
openServerSocket, openServerSocketWithOptions and
openServerSocketWithOpts. They do not call listen, so
runTCPServerWithSocket cannot accept on the resulting socket.
Use openTCPServerSocket and friends instead.
New API: ServerSettings, defaultServerSettings and the
runTCPServerWithSettings, runTCPServerWithSocketAndSettings and
runUDPServerForkWithSettings variants. settingsOnException
receives exceptions which the library catches instead of propagating,
settingsGracefulCloseTimeout controls gracefulClose and
settingsAcceptRetryDelay controls the accept retry interval.
New API: Network.Run.TCP.Timeout now exports resolve,
openTCPServerSocket, openTCPServerSocketWithOptions and
openTCPServerSocketWithOpts.
accept no longer terminates the server on transient errors.
ECONNABORTED and EINTR are retried immediately, and
EMFILE/ENFILE are retried after a short delay and passed to
settingsOnException.
runUDPServerFork is now exception safe. A failure of getAddrInfo,
openServerSocket or connect no longer leaks a socket nor kills
the server; such a datagram is dropped and passed to
settingsOnException instead. An unknown address family is dropped
rather than calling error.
Fixing a bug that runUDPServerFork labels every forked thread with
the first host name.
Documenting IPV6_V6ONLY and the single address family of
runTCPServer.
Network.Run.UDP exports openServerSocket,
openServerSocketWithOptions and openServerSocketWithOpts.
0.5.0
Fixing a bug that TimeoutServer is not killed.
Breaking change: the signatures of Timeout.runTCPServer and
Timeout.runTCPServerWithSocket are changed.