JS8Call-Improved master
Loading...
Searching...
No Matches
TCPClient.h
Go to the documentation of this file.
1
9
10#ifndef TCPCLIENT_H
11#define TCPCLIENT_H
12
13#include "JS8_Include/pimpl_h.h"
14
15#include <QObject>
16#include <QTcpSocket>
17
25class TCPClient : public QObject {
26 Q_OBJECT
27 public:
28 using port_type = quint16;
29
30 explicit TCPClient(QObject *parent = nullptr);
31
32 signals:
33
34 public slots:
39 Q_SLOT bool ensureConnected(QString host, port_type port, int msecs = 5000);
40
50 Q_SLOT bool sendNetworkMessage(QString host, port_type port,
51 QByteArray const &message, bool crlf = true,
52 int msecs = 5000);
53
54 private:
55 class impl;
56 pimpl<impl> m_;
57};
58
59#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)
Ensure a TCP connection to host:port within msecs milliseconds.
Definition TCPClient.cpp:69
Q_SLOT bool sendNetworkMessage(QString host, port_type port, QByteArray const &message, bool crlf=true, int msecs=5000)
Send a short network message to host:port.
Definition TCPClient.cpp:87
Opaque implementation manager utilizing perfect forwarding of constructors.
Definition pimpl_h.h:28
An implementation-hiding utility class template leveraging the Pimpl idiom.