sockets-0.4.0.0: High-level network sockets

Safe HaskellNone
LanguageHaskell2010

Socket.Stream.Interruptible.Bytes

Synopsis

Documentation

send Source #

Arguments

:: TVar Bool

Interrupt. On True, give up and return Left SendInterrupted.

-> Connection

Connection

-> Bytes

Slice of a buffer

-> IO (Either (SendException Interruptible) ()) 

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

:: TVar Bool

Interrupt. On True, give up and return Left ReceiveInterrupted.

-> Connection

Connection

-> Int

Exact number of bytes to receive

-> IO (Either (ReceiveException Interruptible) ByteArray) 

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

:: TVar Bool

Interrupt. On True, give up and return Left ReceiveInterrupted.

-> Connection

Connection

-> Int

Maximum number of bytes to receive

-> IO (Either (ReceiveException Interruptible) ByteArray) 

Receive at most the specified number of bytes. 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

:: TVar Bool

Interrupt. On True, give up and return Left ReceiveInterrupted.

-> Connection

Connection

-> Int

Minimum number of bytes to receive

-> Int

Maximum number of bytes to receive

-> IO (Either (ReceiveException Interruptible) ByteArray) 

Receive a number of bytes that is between the inclusive lower and upper bounds. If needed, this may call recv repeatedly until the minimum requested number of bytes have been received.