liveBook · Manning

Tcp server

As explained in Rust Servers, Services, and Apps

A TCP server is a network service that listens for and accepts connections using Transmission Control Protocol.

A TCP server listens on an address, accepts incoming connections, and exchanges a continuous stream of bytes with clients. Rust’s standard library provides the networking primitives. section 2.0 section 2.4

A minimal implementation proceeds through these operations:

  • Run the server through Cargo within a workspace containing TCP and HTTP projects. section 2.2.2

Echo server

A TCP client connects to localhost:3000, sends “Hello,” and receives the same bytes. The server reports “Connection established” before performing the exchange.

How Rust Servers, Services, and Apps covers it

How deep it goes
Builds a working byte-stream server and client, then stops short of interpreting application messages such as HTTP.
Examples
Uses a Rust echo server and client exchanging “Hello” on localhost:3000 within a Cargo workspace.
What you can do after
Builds and tests a basic TCP server and client using Rust’s standard library and Cargo.
How it connects
Connects TCP servers with TCP clients, TCP/IP layers, HTTP, Rust, and the standard library.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Rust Servers, Services, and Apps. The section links point to the parts of the book it draws on.