darkfi::rpc::common

Function read_from_stream

Source
pub(super) async fn read_from_stream(
    reader: &mut BufReader<ReadHalf<Box<dyn PtStream>>>,
    buf: &mut Vec<u8>,
) -> Result<usize>
Expand description

Internal read function that reads from the active stream into a buffer. Reading stops upon reaching CRLF or LF, or when MAX_BUF_SIZE is reached.