JS8Call-Improved master
Loading...
Searching...
No Matches
TCPClient.h
1#ifndef TCPCLIENT_H
2#define TCPCLIENT_H
3
4#include "JS8_Include/pimpl_h.h"
5
6#include <QObject>
7#include <QTcpSocket>
8
9class TCPClient : public QObject {
10 Q_OBJECT
11 public:
12 using port_type = quint16;
13
14 explicit TCPClient(QObject *parent = nullptr);
15
16 signals:
17
18 public slots:
19 Q_SLOT bool ensureConnected(QString host, port_type port, int msecs = 5000);
20 Q_SLOT bool sendNetworkMessage(QString host, port_type port,
21 QByteArray const &message, bool crlf = true,
22 int msecs = 5000);
23
24 private:
25 class impl;
26 pimpl<impl> m_;
27};
28
29#endif // TCPCLIENT_H
TCPClient(QObject *parent=nullptr)
Construct a new TCPClient::TCPClient object.
Definition TCPClient.cpp:58
Q_SLOT bool ensureConnected(QString host, port_type port, int msecs=5000)
Ensures that the TCP client is connected to the specified host and port.
Definition TCPClient.cpp:69
Q_SLOT bool sendNetworkMessage(QString host, port_type port, QByteArray const &message, bool crlf=true, int msecs=5000)
Sends a network message to the specified host and port.
Definition TCPClient.cpp:87
Definition pimpl_h.h:16