1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
fn main() {
    // create a connection to our example server in server.rs
    let mut connection = std::net::TcpStream::connect("localhost:3333").expect("Failed to connect to server!");
    
    // create a writer
    let mut writer = send_it::writer::VarWriter::default();
    
    // add two segments: "Hello, " and "world!"
    writer.add_string("Hello, ");
    writer.add_string("world!");
    
    // send our two segments to the TcpStream and exit
    writer.send(&mut connection).expect("Failed to send data!");
    println!("sent data!");
}