Tutorial by Examples

To create a TCP connection in Qt, we will use QTcpSocket. First, we need to connect with connectToHost. So for example, to connect to a local tcp serveur: _socket.connectToHost(QHostAddress("127.0.0.1"), 4242); Then, if we need to read datas from the server, we need to connect the signal...
Create a TCP server in Qt is also very easy, indeed, the class QTcpServer already provide all we need to do the server. First, we need to listen to any ip, a random port and do something when a client is connected. like that: _server.listen(QHostAddress::Any, 4242); connect(&_server, SIGNAL...

Page 1 of 1