network-unexceptional-0.2.1.1: Network functions that do not throw exceptions
Safe HaskellSafe-Inferred
LanguageHaskell2010

Network.Unexceptional.Bytes

Synopsis

Documentation

send :: Socket -> Bytes -> IO (Either Errno ()) Source #

Send the entire byte sequence. This call POSIX send in a loop until all of the bytes have been sent.

If this is passed the empty byte sequence, it doesn't actually call POSIX send(). It just returns that it succeeded.

sendInterruptible :: TVar Bool -> Socket -> Bytes -> IO (Either Errno ()) Source #

Variant of send that fails with EAGAIN if the interrupt ever becomes true.

receive Source #

Arguments

:: Socket 
-> Int

Maximum number of bytes to receive

-> IO (Either Errno Bytes) 

If this returns zero bytes, it means that the peer has performed an orderly shutdown.

receiveInterruptible Source #

Arguments

:: TVar Bool

Interrupt

-> Socket 
-> Int

Maximum number of bytes to receive

-> IO (Either Errno Bytes) 

If this returns zero bytes, it means that the peer has performed an orderly shutdown.