Time for action – realizing a simple chat program

To get familiar with QTcpServer and QTcpSocket, let's develop a simple chat program. This example will teach you the basic knowledge of network handling in Qt so that you can use this skill later to connect two or more copies of a game. At the end of this exercise, we want to see something like this:

Time for action – realizing a simple chat program

On both the left-hand side and the right-hand side of the preceding figure, you can see a client, whereas the server is in the middle. We'll start by taking a closer look at the server.

Get Game Programming Using Qt now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.