From 78b7fd514be71081c48fe643570c1cd795b52b13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20L=C3=A4ll?= Date: Sat, 4 Jan 2025 22:49:24 +0200 Subject: [PATCH] Demote `withSocketsDo` - remove it from the examples - move documentation to the bottom of the module as most people won't need it --- Network/Socket.hs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Network/Socket.hs b/Network/Socket.hs index bd98f5ee..5f3de292 100644 --- a/Network/Socket.hs +++ b/Network/Socket.hs @@ -48,7 +48,7 @@ -- > -- > -- from the "network-run" package. -- > runTCPServer :: Maybe HostName -> ServiceName -> (Socket -> IO a) -> IO a --- > runTCPServer mhost port server = withSocketsDo $ do +-- > runTCPServer mhost port server = do -- > addr <- resolve -- > E.bracket (open addr) close loop -- > where @@ -91,7 +91,7 @@ -- > -- > -- from the "network-run" package. -- > runTCPClient :: HostName -> ServiceName -> (Socket -> IO a) -> IO a --- > runTCPClient host port client = withSocketsDo $ do +-- > runTCPClient host port client = do -- > addr <- resolve -- > E.bracket (open addr) close client -- > where @@ -108,9 +108,6 @@ -- threads vs a single 'Socket': one thread reads data from a 'Socket' -- only and the other thread writes data to the 'Socket' only. module Network.Socket ( - -- * Initialisation - withSocketsDo, - -- * Address information getAddrInfo, @@ -401,6 +398,10 @@ import Network.Socket.Buffer hiding ( recvBufMsg, sendBufMsg, sendBufTo, + + -- * Initialisation on Windows + withSocketsDo, + ) import Network.Socket.Cbits import Network.Socket.Fcntl