From 2852083ff301842b77cf7aca5ade8ffc21b90827 Mon Sep 17 00:00:00 2001 From: Elias Rohrer Date: Mon, 17 Feb 2020 16:17:13 +0100 Subject: [PATCH] Using write_all(). --- examples/handshake.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/handshake.rs b/examples/handshake.rs index fa67ca25..a8a1678a 100644 --- a/examples/handshake.rs +++ b/examples/handshake.rs @@ -25,7 +25,7 @@ fn main() { if let Ok(mut stream) = TcpStream::connect(address) { // Send the message - let _ = stream.write(encode::serialize(&first_message).as_slice()); + let _ = stream.write_all(encode::serialize(&first_message).as_slice()); println!("Sent version message"); // Wait for reply and close stream @@ -42,7 +42,7 @@ fn main() { payload: message::NetworkMessage::Verack, }; - let _ = stream.write(encode::serialize(&second_message).as_slice()); + let _ = stream.write_all(encode::serialize(&second_message).as_slice()); println!("Sent verack message"); } message::NetworkMessage::Verack => {