on master help sign in
expose the "connect" operation
commit343aa5d57d6cf1d5e576773b0c7d532f63e47f43 authorHarendra Kumar <harendra.kumar@gmail.com> dateMon 14 Oct 2019, 17:57 (7 years ago) parent3888780
3 files changed+9−6
src/Streamly/Internal/Network/Inet/TCP.hs+4−4 src/Streamly/Network/Inet/TCP.hs+3 src/Streamly/Network/Socket.hs+2−2
src/Streamly/Internal/Network/Inet/TCP.hs+4−4
@@ -216,7 +216,7 @@ connectionsOnLocalHost = connectionsOnAddr (127,0,0,1)
216216
217217-- | Connect to the specified IP address and port number.
218218--
219−-- /Internal/
219+-- @since 0.7.0
220220connect :: (Word8, Word8, Word8, Word8) -> PortNumber -> IO Socket
221221connect addr port = do
222222 sock <- socket AF_INET Stream defaultProtocol
@@ -229,7 +229,7 @@ connect addr port = do
229229-- closing the socket raises an exception, then this exception will be raised
230230-- by 'withServerAddrM'.
231231--
232−-- @since 0.7.0
232+-- /Internal/
233233{-# INLINABLE withServerAddrM #-}
234234withServerAddrM :: (MonadMask m, MonadIO m)
235235 => (Word8, Word8, Word8, Word8) -> PortNumber -> (Socket -> m ()) -> m ()
@@ -246,7 +246,7 @@ withServerAddrM addr port =
246246-- termination or in case of an exception. If closing the socket raises an
247247-- exception, then this exception will be raised by 'withServerAddr'.
248248--
249−-- @since 0.7.0
249+-- /Internal/
250250{-# INLINABLE withServerAddr #-}
251251withServerAddr :: (MonadCatch m, MonadIO m)
252252 => Unfold m Socket a
@@ -266,7 +266,7 @@ withServerAddr =
266266-- handle raises an exception, then this exception will be raised by
267267-- 'withConnection' rather than any exception raised by 'act'.
268268--
269−-- @since 0.7.0
269+-- /Internal/
270270{-# INLINABLE withConnection #-}
271271withConnection :: (IsStream t, MonadCatch m, MonadIO m)
272272 => (Word8, Word8, Word8, Word8) -> PortNumber -> (Socket -> t m a) -> t m a
src/Streamly/Network/Inet/TCP.hs+3
@@ -19,6 +19,9 @@ module Streamly.Network.Inet.TCP
1919 , acceptOnPort
2020 , acceptOnPortLocal
2121
22+ -- * Connect to Servers
23+ , connect
24+
2225 {-
2326 -- ** Sink Servers
2427
src/Streamly/Network/Socket.hs+2−2
@@ -37,7 +37,7 @@ module Streamly.Network.Socket
3737 -- * Accept Connections
3838 , accept
3939
40− -- * Read from connection
40+ -- * Read
4141 , read
4242 -- , readUtf8
4343 -- , readLines
@@ -52,7 +52,7 @@ module Streamly.Network.Socket
5252 , readArraysOf
5353 -- , readArrays
5454
55− -- * Write to connection
55+ -- * Write
5656 , write
5757 -- , writeUtf8
5858 -- , writeUtf8ByLines