A Rust library for simplified safe math operations.
This project provides a basic sample application demonstrating client-server communication in Rust. It includes a simple server program and a corresponding client program that can send and receive messages.
This guide will help you set up and run the client-server sample application.
- Rust compiler: Download and install Rust from the official website https://www.rust-lang.org/tools/install.
- Basic understanding of Rust: Familiarity with core Rust concepts like functions, variables, and data types is recommended.
- Clone this repository:
Bash
git clone https://your_github_url/client-server.git
Use code with caution.
- Navigate to the project directory:
cd client-server
Run 'cargo build' to compile both the client and server programs.
The project includes unit tests for both the client and server code. To run the tests, execute:
Bash
cargo test
- Run the server:
Open a terminal window and navigate to the project directory. Run the following command to start the server:
Bash
cargo run --bin server
This will start the server program, which will listen for incoming connections on a specific port (default: 8080).
- Run the client:
Open another terminal window and navigate to the project directory. Run the following command to start the client program:
Bash
cargo run --bin client
This will start the client program, which will attempt to connect to the server running on the specified port. You can then type messages in the client terminal, and they will be sent to the server and displayed on the server console.
This is a sample application intended for educational purposes. For production deployments, consider using more robust frameworks and libraries designed for client-server communication in Rust.
- Rust - Rust
This project is licensed under the license Creative Commons Attribution 4.0 International (CC-BY-4.0).
- @malledugean - Idea & Initial work
- NearX Rust learning