Creating TCP Server
In this section, we will learn how to create a TCP server that constantly listens to a specific port for incoming messages. For the sake of simplicity, we will just create a global chat room in which every user can see the messages sent by each and every user within the chat room, instead of a one-to-one messaging system with a friend list. You can easily improvise this system to the latter once you have understood how a chat system functions.
First, go to File | New File or Project and choose C++ Class under the C++ category. Then, name the class as server and select QObject as the base class. Make sure the Include QObject option is ticked before proceeding to create the custom class. You should have also noticed the ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access