@@ -21,13 +21,12 @@
21module Streamly.Internal.Network.Inet.TCP
21module Streamly.Internal.Network.Inet.TCP
23 -- * TCP Servers
23 -- * TCP Servers
24− -- ** Connected sockets
25− -- *** Unfolds
24+ -- ** Unfolds
26− listenOnAddr
25+ acceptOnAddr
27− , listenOnPort
26+ , acceptOnPort
28− , listenOnPortLocal
27+ , acceptOnPortLocal
30− -- *** Streams
29+ -- ** Streams
31 , connections
30 , connections
32 , connectionsOnAddr
31 , connectionsOnAddr
33 , connectionsOnAllAddrs
32 , connectionsOnAllAddrs
@@ -120,11 +119,11 @@ import qualified Streamly.Internal.Network.Socket as ISK
120-- connections are accepted.
119-- connections are accepted.
122-- @since 0.7.0
121-- @since 0.7.0
123−{-# INLINE listenOnAddr #-}
122+{-# INLINE acceptOnAddr #-}
124−listenOnAddr
123+acceptOnAddr
125 :: MonadIO m
124 :: MonadIO m
126 => Unfold m ((Word8, Word8, Word8, Word8), PortNumber) Socket
125 => Unfold m ((Word8, Word8, Word8, Word8), PortNumber) Socket
127−listenOnAddr = UF.lmap f listen
126+acceptOnAddr = UF.lmap f listen
129 f (addr, port) =
128 f (addr, port) =
130 (maxListenQueue
129 (maxListenQueue
@@ -137,27 +136,27 @@ listenOnAddr = UF.lmap f listen
137 , SockAddrInet port (tupleToHostAddress addr)
136 , SockAddrInet port (tupleToHostAddress addr)
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
141-- IPv4 addresses/interfaces of the machine and listens for TCP connections on
140-- IPv4 addresses/interfaces of the machine and listens for TCP connections on
142-- the specified port.
141-- the specified port.
144−-- > listenOnPort = UF.supplyFirst listenOnAddr (0,0,0,0)
143+-- > acceptOnPort = UF.supplyFirst acceptOnAddr (0,0,0,0)
146-- @since 0.7.0
145-- @since 0.7.0
147−{-# INLINE listenOnPort #-}
146+{-# INLINE acceptOnPort #-}
148−listenOnPort :: MonadIO m => Unfold m PortNumber Socket
147+acceptOnPort :: MonadIO m => Unfold m PortNumber Socket
149−listenOnPort = UF.supplyFirst listenOnAddr (0,0,0,0)
148+acceptOnPort = UF.supplyFirst acceptOnAddr (0,0,0,0)
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@.
152-- The server can only be accessed from the local host, it cannot be accessed
151-- The server can only be accessed from the local host, it cannot be accessed
153-- from other hosts on the network.
152-- from other hosts on the network.
155−-- > listenOnPortLocal = UF.supplyFirst listenOnAddr (127,0,0,1)
154+-- > acceptOnPortLocal = UF.supplyFirst acceptOnAddr (127,0,0,1)
157-- @since 0.7.0
156-- @since 0.7.0
158−{-# INLINE listenOnPortLocal #-}
157+{-# INLINE acceptOnPortLocal #-}
159−listenOnPortLocal :: MonadIO m => Unfold m PortNumber Socket
158+acceptOnPortLocal :: MonadIO m => Unfold m PortNumber Socket
160−listenOnPortLocal = UF.supplyFirst listenOnAddr (127,0,0,1)
159+acceptOnPortLocal = UF.supplyFirst acceptOnAddr (127,0,0,1)
162-------------------------------------------------------------------------------
161-------------------------------------------------------------------------------