A Lot of common web protocols include http, ftp, websockets and so on use TCP. So, it's good to have basic understanding of how TCP works.
This project is a simple example which shows communication between a TCP server and client.
In this example, the server accepts connections and store all connections. Then, every time receive data it sends the data to all connected clients.
In this example, the client connects to the server and send a message and then closes the connection.