Skip to content

Commit

Permalink
Update examples/ping-pong/src/server.rs
Browse files Browse the repository at this point in the history
Co-authored-by: pythcoiner <[email protected]>
  • Loading branch information
plebhash and pythcoiner authored Jun 20, 2024
1 parent 96002b8 commit 65b14fd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/ping-pong/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ fn handle_connection(mut stream: TcpStream) -> Result<(), Error> {

// right now, the decoder buffer can only read a frame header
// because decoder.missing_b is initialized with a header size
let mut decoder_buf = decoder.writable();
let decoder_buf = decoder.writable();

// read frame header into decoder_buf
stream.read_exact(&mut decoder_buf)?;
stream.read_exact(decoder_buf)?;

// this returns an error (MissingBytes), because it only read the header, and there's no payload in memory yet
// therefore, we safely ignore the error
Expand Down

0 comments on commit 65b14fd

Please sign in to comment.