@@ -21,13 +21,12 @@
2121module Streamly.Internal.Network.Inet.TCP
2222 (
2323 -- * TCP Servers
24− -- ** Connected sockets
25− -- *** Unfolds
26− listenOnAddr
27− , listenOnPort
28− , listenOnPortLocal
24+ -- ** Unfolds
25+ acceptOnAddr
26+ , acceptOnPort
27+ , acceptOnPortLocal
2928
30− -- *** Streams
29+ -- ** Streams
3130 , connections
3231 , connectionsOnAddr
3332 , connectionsOnAllAddrs
@@ -120,11 +119,11 @@ import qualified Streamly.Internal.Network.Socket as ISK
120119-- connections are accepted.
121120--
122121-- @since 0.7.0
123−{-# INLINE listenOnAddr #-}
124−listenOnAddr
122+{-# INLINE acceptOnAddr #-}
123+acceptOnAddr
125124 :: MonadIO m
126125 => Unfold m ((Word8, Word8, Word8, Word8), PortNumber) Socket
127−listenOnAddr = UF.lmap f listen
126+acceptOnAddr = UF.lmap f listen
128127 where
129128 f (addr, port) =
130129 (maxListenQueue
@@ -137,27 +136,27 @@ listenOnAddr = UF.lmap f listen
137136 , SockAddrInet port (tupleToHostAddress addr)
138137 )
139138
140−-- | Like 'listenOnAddr' but binds on the IPv4 address @0.0.0.0@ i.e. on all
139+-- | Like 'acceptOnAddr' but binds on the IPv4 address @0.0.0.0@ i.e. on all
141140-- IPv4 addresses/interfaces of the machine and listens for TCP connections on
142141-- the specified port.
143142--
144−-- > listenOnPort = UF.supplyFirst listenOnAddr (0,0,0,0)
143+-- > acceptOnPort = UF.supplyFirst acceptOnAddr (0,0,0,0)
145144--
146145-- @since 0.7.0
147−{-# INLINE listenOnPort #-}
148−listenOnPort :: MonadIO m => Unfold m PortNumber Socket
149−listenOnPort = UF.supplyFirst listenOnAddr (0,0,0,0)
146+{-# INLINE acceptOnPort #-}
147+acceptOnPort :: MonadIO m => Unfold m PortNumber Socket
148+acceptOnPort = UF.supplyFirst acceptOnAddr (0,0,0,0)
150149
151−-- | Like 'listenOnAddr' but binds on the localhost IPv4 address @127.0.0.1@.
150+-- | Like 'acceptOnAddr' but binds on the localhost IPv4 address @127.0.0.1@.
152151-- The server can only be accessed from the local host, it cannot be accessed
153152-- from other hosts on the network.
154153--
155−-- > listenOnPortLocal = UF.supplyFirst listenOnAddr (127,0,0,1)
154+-- > acceptOnPortLocal = UF.supplyFirst acceptOnAddr (127,0,0,1)
156155--
157156-- @since 0.7.0
158−{-# INLINE listenOnPortLocal #-}
159−listenOnPortLocal :: MonadIO m => Unfold m PortNumber Socket
160−listenOnPortLocal = UF.supplyFirst listenOnAddr (127,0,0,1)
157+{-# INLINE acceptOnPortLocal #-}
158+acceptOnPortLocal :: MonadIO m => Unfold m PortNumber Socket
159+acceptOnPortLocal = UF.supplyFirst acceptOnAddr (127,0,0,1)
161160
162161-------------------------------------------------------------------------------
163162-- Listen