August 2025
Intermediate to advanced
272 pages
6h 14m
English
Our echo server will listen for TCP client connections and will be able to keep multiple connections open at the same time. When a client sends a line of data (characters ending in a newline \n), our server will send that line of data back. That’s all.
First things first—let’s create a new Mix project for our server:
| | > mix new tcp_echo_server --sup --module TCPEchoServer |
| | * creating README.md |
| | * creating .formatter.exs |
| | * creating .gitignore |
| | * creating mix.exs |
| | * creating lib |
| | * creating lib/tcp_echo_server.ex |
| | * creating lib/tcp_echo_server/application.ex |
| | * creating test |
| | * creating test/test_helper.exs |
| | * creating test/tcp_echo_server_test.exs |
| | |
| | Your Mix project was created successfully. ... |
Read now
Unlock full access