Function tcp_handler::protocols::raw::recv

source ·
pub async fn recv<R: AsyncRead + Unpin>(
    stream: &mut R
) -> Result<BytesMut, PacketError>
Expand description

Recv the message in raw tcp-handler protocol.

§Arguments

  • stream - The tcp stream or ReadHalf.

§Example

use tcp_handler::protocols::raw::recv;

let mut reader = recv(&mut server).await?.reader();
let message = reader.read_string()?;