Skip to content

thepacketgeek/rust-tcpstream-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ready & Writing data with Rust's TcpStream

This repo contains examples of using Rust's TcpStream to send & receive data between a client and server. This example shows low-level data (raw bytes) reading & writing with Rust's TcpStream. Subsequent examples add abstractions over this, but it's helpful to understand what's happening under the hood and why abstractions make things easier.

See how the Read and Write traits work with low-level TcpStream Tx/Rx

Step up a level of abstraction using line-based messaging (newline delimited) and how the BufRead and BufWrite traits can be more effecient

If we want to send more than just lines, we can abstract even further into a protocol of structs, handling serialization & deserialization with byteorder

About

Examples of reading/writing data from TcpStream in Rust

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages