@[inline]
Receive up to maxlen bytes from a connected socket. Returns empty ByteArray on EOF.
Uses the blocking wrapper that loops on wouldBlock.
$$\text{recv} : \text{Socket}\ \texttt{.connected} \to \mathbb{N} \to \text{IO}(\text{ByteArray})$$
Equations
- Network.Socket.Recv.recv sock maxlen = Network.Socket.Blocking.recv sock maxlen
Instances For
@[inline]
Receive data as a String (UTF-8 decoded) from a connected socket.
Equations
- Network.Socket.Recv.recvString sock maxlen = do let data ← Network.Socket.Recv.recv sock maxlen pure (String.fromUTF8! data)