sockets-0.4.0.0: High-level network sockets

Safe HaskellNone
LanguageHaskell2010

Socket.Stream.Uninterruptible.MutableBytes

Synopsis

Documentation

send Source #

Arguments

:: Connection

Connection

-> MutableBytes RealWorld

Slice of a buffer

-> IO (Either (SendException Uninterruptible) ()) 

Send a slice of a buffer. If needed, this calls POSIX send repeatedly until the entire contents of the buffer slice have been sent.

receiveExactly Source #

Arguments

:: Connection

Connection

-> MutableBytes RealWorld

Slice of a buffer

-> IO (Either (ReceiveException Uninterruptible) ()) 

Receive a number of bytes exactly equal to the length of the buffer slice. If needed, this may call recv repeatedly until the requested number of bytes have been received.

receiveOnce Source #

Arguments

:: Connection

Connection

-> MutableBytes RealWorld

Slice of a buffer

-> IO (Either (ReceiveException Uninterruptible) Int) 

Receive a number of bytes exactly equal to the length of the slice. This only makes multiple calls to POSIX recv if EAGAIN is returned. It makes at most one recv call that successfully fills the buffer.

receiveBetween Source #

Arguments

:: Connection

Connection

-> MutableBytes RealWorld

Slice of a buffer

-> Int

Minimum number of bytes to receive, must be less than or equal to the length of the slice.

-> IO (Either (ReceiveException Uninterruptible) Int) 

Receive a number of bytes that is at least the minimum size and is at most the length of the slice. If needed, this may call recv repeatedly until the minimum requested number of bytes have been received.