|
The MassDataClient class provides a network client. More...
Header: | #include <MassDataClient.hpp> |
Inherits: | QObject |
MassDataClient(const QString &ip_address, int port_number, int connection_frequency = 1, QObject *parent = nullptr) | |
virtual | ~MassDataClient() |
QString | getStatus() |
virtual void | readData() |
void | reportError(QAbstractSocket::SocketError socket_error) |
void | requestNewData() |
int | m_connectionFrequency |
QByteArray | m_data |
QDataStream | m_inStream |
QString | m_ipAddress |
int | m_portNumber |
QTcpSocket * | mpa_tcpSocket |
[explicit]
MassDataClient::MassDataClient(const QString &ip_address, int port_number, int connection_frequency = 1, QObject *parent = nullptr)Constructs a MassDataClient instance.
[virtual noexcept]
MassDataClient::~MassDataClient()Destructs this MassDataClient instance.
Returns a string display the connection details.
[virtual protected slot]
void MassDataClient::readData()Reads the data into the QByteArray m_data member using the QDataStream m_inStream member.
Emits the newDataSignal() signal with m_data;.
[protected slot]
void MassDataClient::reportError(QAbstractSocket::SocketError socket_error)Reports the error socket_error.
[protected slot]
void MassDataClient::requestNewData()Tries a connection to the server using the member QTcpSocket.
This variable holds the frequency at which the client connects to the server, in times per second.
A frequency of 1 means that the connection will be tried once per second. This is empirically correct.
This variable holds the data being transported.
This variable holds the data stream in input in this MassDataClient instance.
This variable holds the server IP address to which the connection must be made.
This variable holds the port number to which to attach during the connection..
This variable holds the socket that is used for the connection.