| Copyright | (c) 2019 Composewell Technologies |
|---|---|
| License | BSD3 |
| Maintainer | streamly@composewell.com |
| Stability | released |
| Portability | GHC |
| Safe Haskell | None |
| Language | Haskell2010 |
Streamly.Network.Inet.TCP
Description
Combinators to build Inet/TCP clients and servers.
import qualified Streamly.Network.Inet.TCP as TCP
Synopsis
- acceptOnAddr :: MonadIO m => Unfold m ((Word8, Word8, Word8, Word8), PortNumber) Socket
- acceptOnPort :: MonadIO m => Unfold m PortNumber Socket
- acceptOnPortLocal :: MonadIO m => Unfold m PortNumber Socket
- connect :: (Word8, Word8, Word8, Word8) -> PortNumber -> IO Socket
Accept Connections
acceptOnAddr :: MonadIO m => Unfold m ((Word8, Word8, Word8, Word8), PortNumber) Socket Source #
Unfold a tuple (ipAddr, port) into a stream of connected TCP sockets.
ipAddr is the local IP address and port is the local port on which
connections are accepted.
Since: 0.7.0
acceptOnPort :: MonadIO m => Unfold m PortNumber Socket Source #
Like acceptOnAddr but binds on the IPv4 address 0.0.0.0 i.e. on all
IPv4 addresses/interfaces of the machine and listens for TCP connections on
the specified port.
acceptOnPort = UF.supplyFirst acceptOnAddr (0,0,0,0)
Since: 0.7.0
acceptOnPortLocal :: MonadIO m => Unfold m PortNumber Socket Source #
Like acceptOnAddr but binds on the localhost IPv4 address 127.0.0.1.
The server can only be accessed from the local host, it cannot be accessed
from other hosts on the network.
acceptOnPortLocal = UF.supplyFirst acceptOnAddr (127,0,0,1)
Since: 0.7.0