31#include <QLocalSocket>
93 bool read(
void* buffer,
int size);
104 bool read(QVector<T>& values);
118 static const char* channelIDString;
123 bool readSocketTag();
125 QLocalSocket* socket_;
137 if (!
read((
void*)&count,
sizeof(
unsigned int))) {
142 qWarning() <<
"Too many samples waiting in socket. Flushing it to empty";
146 values.resize(values.size() + count);
147 if (!
read((
void*)values.data(),
sizeof(T) * count)) {
148 qWarning() <<
"Error occured while reading data from socket: " << socket_->errorString();
Helper class for reading socket datachannel from sensord.
SocketReader(QObject *parent=0)
Constructor.
~SocketReader()
Destructor.
bool dropConnection()
Drops socket connection.
bool isConnected()
Returns whether the socket is currently connected.
bool initiateConnection(int sessionId)
Initiates new data socket connection.
QLocalSocket * socket()
Provides access to the internal QLocalSocket for direct reading.
bool read(void *buffer, int size)
Attempt to read given number of bytes from the socket.