https://github.com/mbari-org/espclient
An ESP client implementation in Rust
https://github.com/mbari-org/espclient
rust tcp tcp-client
Last synced: 10 months ago
JSON representation
An ESP client implementation in Rust
- Host: GitHub
- URL: https://github.com/mbari-org/espclient
- Owner: mbari-org
- License: apache-2.0
- Created: 2020-08-18T23:19:34.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2025-02-02T22:34:24.000Z (11 months ago)
- Last Synced: 2025-03-29T04:38:16.783Z (10 months ago)
- Topics: rust, tcp, tcp-client
- Language: Rust
- Homepage:
- Size: 2.52 MB
- Stars: 1
- Watchers: 6
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

# ESP Client in Rust
- What: This is an ESP client[^ESP] implementation in Rust.
- Why: Practice some basic Rust socket programming.
- How: Using standard Rust libraries for socket connection and some others.
[^ESP]: Similar to the "espclient" program that is part of the
[MBARI Environmental Sample Processor system](
https://www.mbari.org/technology/environmental-sample-processor-esp/).
## Installing
With `cargo` on your system, you can install `espclient` directly from
the repo as follows:
```
$ cargo install --git https://github.com/mbari-org/espclient.git
```
Of course, you can also clone this repo and then run tests, run the program, build, etc.:
```
$ cargo test
Compiling espclient v...
Finished test [unoptimized + debuginfo] target(s) in 0.97s
Running target/debug/deps/espclient-134c8ea5e5ff6ed0
running 2 tests
test encoder::tests::encode_line_tests ... ok
test decoder::tests::unfinished_line ... ok
test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
```
Common commands I run here (see [justfile](justfile)):
just test
just clippy
just format
just release
just install
just outdated
just update
## Running
Have an ESP server running somewhere and then launch the program indicating
the corresponding `host:port`, for example:
`espclient bufflehead.shore.mbari.org:7777` (see below).
Program usage:
```
$ espclient --help
ESP Client in Rust
Usage: espclient [OPTIONS]
Arguments:
host:port indicating the running ESP server to connect to
Options:
-n, --name My name as client for ESP server's log [default: espclient.rs]
-c, --cmd Command beginning interactive session [default: "showlog 0"]
-s, --simple Simple output (by default, show stream multiplexing explicitly)
-d, --debug Summarize raw socket traffic on STDERR
-h, --help Print help
-V, --version Print version
```
---
See a quick demo [here](demo/index.md).
## Change log
- 2025-02: maintenance update
- 2023-10: rustyline updated
- 2023-06: just some dep updates
- 2022-11-13: do various dep updates and set 2021 edition
- 2022-09-17: fix #1 to address critical dependabot notification
- 2022-01-27: general updates
- 2022-01-05: enable ci; fix clippy error
- 2021-04-20: enable colored CLI
- 2020-08-19: various adjustments incl improved/simplified prompt handling.
- 2020-08-18: initial functional version
## Some refs
- https://blog.burntsushi.net/rust-error-handling/#the-error-trait
- https://github.com/jtenner/telnet_codec