Portability | portable |
---|---|
Maintainer | jmillikin@gmail.com |
Safe Haskell | Safe-Infered |
Network.Socket.Enumerator
Description
- enumSocket :: MonadIO m => Integer -> Socket -> Enumerator ByteString m b
- enumSocketFrom :: MonadIO m => Integer -> Socket -> Enumerator (ByteString, SockAddr) m b
- enumSocketTimed :: MonadIO m => Integer -> Integer -> Socket -> Enumerator ByteString m b
- iterSocket :: MonadIO m => Socket -> Iteratee ByteString m ()
- iterSocketTo :: MonadIO m => Socket -> SockAddr -> Iteratee ByteString m ()
- iterSocketTimed :: MonadIO m => Integer -> Socket -> Iteratee ByteString m ()
Documentation
Arguments
:: MonadIO m | |
=> Integer | Buffer size |
-> Socket | |
-> Enumerator ByteString m b |
Arguments
:: MonadIO m | |
=> Integer | Buffer size |
-> Socket | |
-> Enumerator (ByteString, SockAddr) m b |
Arguments
:: MonadIO m | |
=> Integer | Buffer size |
-> Integer | Timeout, in microseconds |
-> Socket | |
-> Enumerator ByteString m b |
Enumerate binary data from a Socket
, using recv
. The socket must
be connected.
The buffer size should be a small power of 2, such as 4096.
If any call to recv
takes longer than the timeout, enumSocketTimed
will throw an error. To add a timeout for the entire session, wrap the
call to run
in timeout
.
Since: 0.1.2
iterSocket :: MonadIO m => Socket -> Iteratee ByteString m ()Source
iterSocketTo :: MonadIO m => Socket -> SockAddr -> Iteratee ByteString m ()Source
Write data to a Socket
, using sendManyTo
. The socket does not
have to be connected.