Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jam1garner/network-reader
A client/server protocol for using `io::Read` and `io::Seek` over a network
https://github.com/jam1garner/network-reader
Last synced: 4 days ago
JSON representation
A client/server protocol for using `io::Read` and `io::Seek` over a network
- Host: GitHub
- URL: https://github.com/jam1garner/network-reader
- Owner: jam1garner
- Created: 2020-11-10T09:55:22.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2021-01-23T20:35:41.000Z (almost 4 years ago)
- Last Synced: 2025-01-03T02:54:01.151Z (5 days ago)
- Language: Rust
- Size: 2.93 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# network-reader
A client/server protocol for using `io::Read` and `io::Seek` over a network
**Server example:**
```rust
use network_reader::Networked;Networked::new_buffered(File::open("my_file.txt").unwrap(), ("127.0.0.1", 4000))
.unwrap()
.listen()
.unwrap();
```**Client example:**
```rust
use network_reader::NetworkReader;let mut reader = NetworkReader::new(("127.0.0.1", 4000)).unwrap();
// Read 4 bytes from Reader provided over the network
let mut buf = [0u8; 4];
reader.read_exact(&mut buf).unwrap();
```If the two above samples were used together, the client would read the first 4 bytes from file "my_file.txt".