51 #include <QtCore/QDebug> 55 #include <QStringBuilder> 68 m_debug(debug),timer_(this),timer2_(this)
71 qDebug() <<
"WebSocket server:" << url;
82 qDebug() <<
"WebSocket connected";
90 connect(&
timer_, &QTimer::timeout, [&](){
93 connect(&
timer2_, &QTimer::timeout, [&](){
102 using namespace std::chrono;
103 static std::chrono::high_resolution_clock::time_point initial_time = high_resolution_clock::now();
105 double steps = 1000.0;
111 auto now = high_resolution_clock::now();
112 const double t = duration_cast< duration<double>>( now - initial_time ).count() ;
113 QString str = key+QString(
":")
114 + QString::number(t)+
":" 115 + QString::number(value);
125 qDebug() <<
"Message received:" << message;
Client(const QUrl &url, bool debug=false, QObject *parent=Q_NULLPTR)
[constructor]
void sendMsg(const QString &key)
void onTextMessageReceived(QString message)
[onConnected]
void onConnected()
[constructor]