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

Network.Unexceptional.MutableBytes

Description

sockets convert a reception length of zero to an non-standard EOI error code. Datagram reception functions do not do this.

Synopsis

Stream Sockets

receive Source #

Arguments

:: Socket 
-> MutableBytes RealWorld

Slice of a buffer

-> IO (Either Errno Int) 

Receive bytes from a socket. Receives at most N bytes, where N is the size of the buffer. Returns the number of bytes that were actually received.

receiveInterruptible Source #

Arguments

:: TVar Bool

Interrupt

-> Socket 
-> MutableBytes RealWorld

Slice of a buffer

-> IO (Either Errno Int) 

receiveExactly Source #

Arguments

:: Socket 
-> MutableBytes RealWorld

Length is the exact number of bytes to receive, must be greater than zero.

-> IO (Either Errno ()) 

Blocks until an exact number of bytes has been received.

receiveExactlyInterruptible Source #

Arguments

:: TVar Bool 
-> Socket 
-> MutableBytes RealWorld

Length is the exact number of bytes to receive, must be greater than zero.

-> IO (Either Errno ()) 

Datagram Sockets

receiveFromInterruptible Source #

Arguments

:: TVar Bool 
-> Socket 
-> MutableBytes RealWorld

Slice of a buffer

-> IO (Either Errno (Int, SockAddr)) 

Receive bytes from a socket. Receives at most N bytes, where N is the size of the buffer. Returns the number of bytes that were actually received.