Creating a server-side application
Networking plays a major role in modern life. We need to understand how communication is established between two machines. When two machines communicate, one is usually a server and the other is a client. The client sends requests to the server and the server responds by serving the request made by the client.
In this recipe, we will be creating a client-server application where a connection is established between client and server and each will be able to transfer text messages to the other. That is, two applications will be made and will be executed simultaneously, and the text written in one application will appear in the other.
How to do it...
Let's begin by creating a server application first, as follows:
- Create an application based on the
Dialog without Buttons
template. - Add a
QLabel
,QTextEdit
,QLineEdit
, andQPushButton
to the form by dragging and dropping theLabel
, aText Edit
,Line Edit
, andPush Button
widgets on the form.
- Set the
text
property of...