blob: 67b72a5da39426aa91cc11ea599789d5c0cd71fc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
/*
*/
/*! \page clientserver-example.html
\ingroup network-examples
\title A small client-server example
This example shows how two programs can communicate using sockets.
Two simple example programs are provided, a client program and a
server program. Both use the QSocket class, and the server also uses
QServerSocket class.
The server listens on port number 4242 and accepts incoming connections.
It sends back every line it receives from the client, prepended with
the line number.
The client tries to connect to the server on the host specified on the
command line or to localhost if no command line arguments are
specified. You can send single lines to the server.
<hr>
Implementation server (server.cpp):
\include network/clientserver/server/server.cpp
<hr>
Implementation client (client.cpp):
\include network/clientserver/client/client.cpp
*/
|