annotate README.md @ 14:f6fc13a3fe88

update readme
author Dennis <dennisconcepcionmartin@gmail.com>
date Fri, 21 Jul 2023 10:10:12 +0100
parents dc97a1196f45
children 07f578438b0f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3
e96eaa6b74c1 rename project to hey!
Dennis <dennisconcepcionmartin@gmail.com>
parents: 1
diff changeset
1 # Hey!
e96eaa6b74c1 rename project to hey!
Dennis <dennisconcepcionmartin@gmail.com>
parents: 1
diff changeset
2
14
f6fc13a3fe88 update readme
Dennis <dennisconcepcionmartin@gmail.com>
parents: 12
diff changeset
3 Hey! is a simple TCP streaming app.
f6fc13a3fe88 update readme
Dennis <dennisconcepcionmartin@gmail.com>
parents: 12
diff changeset
4
f6fc13a3fe88 update readme
Dennis <dennisconcepcionmartin@gmail.com>
parents: 12
diff changeset
5 ## Usage
f6fc13a3fe88 update readme
Dennis <dennisconcepcionmartin@gmail.com>
parents: 12
diff changeset
6
f6fc13a3fe88 update readme
Dennis <dennisconcepcionmartin@gmail.com>
parents: 12
diff changeset
7 Make sure you have Docker installed.
f6fc13a3fe88 update readme
Dennis <dennisconcepcionmartin@gmail.com>
parents: 12
diff changeset
8
f6fc13a3fe88 update readme
Dennis <dennisconcepcionmartin@gmail.com>
parents: 12
diff changeset
9 ```bash
f6fc13a3fe88 update readme
Dennis <dennisconcepcionmartin@gmail.com>
parents: 12
diff changeset
10 ./run.sh
f6fc13a3fe88 update readme
Dennis <dennisconcepcionmartin@gmail.com>
parents: 12
diff changeset
11 ```
f6fc13a3fe88 update readme
Dennis <dennisconcepcionmartin@gmail.com>
parents: 12
diff changeset
12
f6fc13a3fe88 update readme
Dennis <dennisconcepcionmartin@gmail.com>
parents: 12
diff changeset
13 Using docker compose, this script build the Docker images (server and client), create a user-defined bridge network, and run both containers.
f6fc13a3fe88 update readme
Dennis <dennisconcepcionmartin@gmail.com>
parents: 12
diff changeset
14 After that, you will be provided with the client shell to send messages to the server.
f6fc13a3fe88 update readme
Dennis <dennisconcepcionmartin@gmail.com>
parents: 12
diff changeset
15
f6fc13a3fe88 update readme
Dennis <dennisconcepcionmartin@gmail.com>
parents: 12
diff changeset
16 To close the connection type `exit` from the client shell and press `ENTER`.
f6fc13a3fe88 update readme
Dennis <dennisconcepcionmartin@gmail.com>
parents: 12
diff changeset
17
f6fc13a3fe88 update readme
Dennis <dennisconcepcionmartin@gmail.com>
parents: 12
diff changeset
18 Some things that I find interesting:
f6fc13a3fe88 update readme
Dennis <dennisconcepcionmartin@gmail.com>
parents: 12
diff changeset
19 - Run `docker logs --follow hey-server-1` in another terminal. Doing that you can see the messages arrive at the server.
f6fc13a3fe88 update readme
Dennis <dennisconcepcionmartin@gmail.com>
parents: 12
diff changeset
20 - If you have Wireshark installed you can use it to sniff the packets sent in the Docker network. This is good to understand TCP.
f6fc13a3fe88 update readme
Dennis <dennisconcepcionmartin@gmail.com>
parents: 12
diff changeset
21
f6fc13a3fe88 update readme
Dennis <dennisconcepcionmartin@gmail.com>
parents: 12
diff changeset
22 ## What you could do next?
f6fc13a3fe88 update readme
Dennis <dennisconcepcionmartin@gmail.com>
parents: 12
diff changeset
23
f6fc13a3fe88 update readme
Dennis <dennisconcepcionmartin@gmail.com>
parents: 12
diff changeset
24 A good exercise will be to implement logic for some commands in the server. For example, you could program the server to send to the client the current
f6fc13a3fe88 update readme
Dennis <dennisconcepcionmartin@gmail.com>
parents: 12
diff changeset
25 date every time the server receives the command `date`.
1
58952f1fb8da minimal socket example
Dennis <dennisconcepcionmartin@gmail.com>
parents: 0
diff changeset
26
58952f1fb8da minimal socket example
Dennis <dennisconcepcionmartin@gmail.com>
parents: 0
diff changeset
27 ## References
58952f1fb8da minimal socket example
Dennis <dennisconcepcionmartin@gmail.com>
parents: 0
diff changeset
28
14
f6fc13a3fe88 update readme
Dennis <dennisconcepcionmartin@gmail.com>
parents: 12
diff changeset
29 This is the material I used to develop Hey!. The Beej's Guide to Network Programming is a nice introduction. Super easy to read:
1
58952f1fb8da minimal socket example
Dennis <dennisconcepcionmartin@gmail.com>
parents: 0
diff changeset
30 - [What is a web server](https://developer.mozilla.org/en-US/docs/Learn/Common_questions/Web_mechanics/What_is_a_web_server)
58952f1fb8da minimal socket example
Dennis <dennisconcepcionmartin@gmail.com>
parents: 0
diff changeset
31 - [HTTP Protocol](https://www.rfc-editor.org/rfc/pdfrfc/rfc7231.txt.pdf)
58952f1fb8da minimal socket example
Dennis <dennisconcepcionmartin@gmail.com>
parents: 0
diff changeset
32 - [Socket programming Oracle](https://docs.oracle.com/cd/E19253-01/817-4415/6mjum5som/index.html)
3
e96eaa6b74c1 rename project to hey!
Dennis <dennisconcepcionmartin@gmail.com>
parents: 1
diff changeset
33 - [Beej's Guide to Network Programming](https://beej.us/guide/bgnet/html/split/index.html)
5
45bac89a4da3 fix 'address already in use' before bind()
Dennis <dennisconcepcionmartin@gmail.com>
parents: 3
diff changeset
34 - [How does port number really work](https://stackoverflow.com/questions/13190176/how-does-port-number-really-work-in-tcp/29045432#29045432)