trx/src/rx/main.rs
2022-07-23 20:43:35 -05:00

16 lines
353 B
Rust

use tokio::net::TcpStream;
use tokio::io::{AsyncWriteExt};
use std::error::Error;
#[tokio::main]
async fn main() -> Result<(), Box<dyn Error>> {
// Connect to a peer
let mut stream = TcpStream::connect("127.0.0.1:8080").await?;
let mut _buffer = [0, 16];
// Write some data.
stream.write_all(b"hello world!").await?;
Ok(())
}