6 #ifndef REALTIMETCPCONNECTION_H_
7 #define REALTIMETCPCONNECTION_H_
9 #include "ocurvesconfig.h"
11 #include "realtimeconnection.h"
13 #include <QHostAddress>
31 virtual QString
name()
const override;
44 bool open(
const QHostAddress &address, quint16 port, uint timeout = 5000);
55 int send(
const QByteArray &buffer)
override;
59 int read(QByteArray &buffer)
override;
65 #endif // REALTIMETCPCONNECTION_H_
int read(QByteArray &buffer) override
Read data into the given buffer.
RealTimeTcpConnection()
Create an unconnected TCP connection.
int send(const QByteArray &buffer) override
Send the given buffer to the source.
A RealTimeSource which reads from a TCP socket.
Definition: realtimetcpconnection.h:20
This is the base class for data source which provides data in real time.
Definition: realtimeconnection.h:16
virtual QString name() const override
The TCP address being used.
virtual bool isConnected() const override
Is the port open and connected?
bool open(const QHostAddress &address, quint16 port, uint timeout=5000)
Open a TCP connection to the indicated address and port.
~RealTimeTcpConnection()
Destructor, ensures disconnect() is called.
virtual void disconnect() override
Disconnect if connected.