Now we are starting to get into the realm of network and the internet. WebSockets are a protocol that allows two-way data exchange between a web browser or client and a server without polling. You can stream data or send data at any time. Qt has support for WebSockets through the use of the QWebSocket API. Like normal TCP sockets, QWebSockets needs a server.
WebSockets – Bi-directional web communication
QWebSocketServer
QWebSocketServer can work in two modes: non-secure and SSL. We start by adding websockets to the .pro file so qmake sets up the proper library and header paths:
QT += websockets
Then include the QWebSocketServer header file:
#include <QtWebSockets/QWebSocketServer>
The source...