Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/advaita-saha/tcp-socket-server
A TCP server client program written in Rust.
https://github.com/advaita-saha/tcp-socket-server
rust tcp-client tcp-server tcp-socket
Last synced: about 1 month ago
JSON representation
A TCP server client program written in Rust.
- Host: GitHub
- URL: https://github.com/advaita-saha/tcp-socket-server
- Owner: advaita-saha
- Created: 2023-07-20T17:55:46.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2023-07-21T03:40:00.000Z (over 1 year ago)
- Last Synced: 2024-10-22T22:56:00.409Z (3 months ago)
- Topics: rust, tcp-client, tcp-server, tcp-socket
- Language: Rust
- Homepage:
- Size: 3.91 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Socket Programing in Rust
This is a TCP server client program written in Rust. The server is a simple echo server that echoes back whatever the client sends to it. The client sends a message to the server and waits for the server to echo back the message. The client then prints the message to the console.
## How to run
```bash
# Run the server
cargo run -p tcpserver# Run the client (in a different terminal) [don't close the terminal running the server]
cargo run -p tcpclient
```
## The TCP LayerThe provides reliable end-to-end communication. While the application layer Transport layer
deals with messages that have specific semantics (such as sending a GET request to get shipment
details), the transport protocols deal with sending and receiving raw bytes. (Note: all application
layer protocol messages eventually get converted into raw bytes for transmission by the transport
layer). TCP and UDP are the two main protocols used in this layer, with QUIC (Quick UDP
Internet Connection) also being a recent entrant. TCP is a connection-oriented protocol that
allows data to be partitioned for transmission and reassembled in a reliable manner at the
receiving end. UDP is a connectionless protocol and does not provide guarantees on delivery,
unlike TCP. UDP is consequently faster and suitable for certain class of applications eg DNS
lookups, voice or video applications. Here, we will focus on the TCP protocol for transport
layer.