Socket API: Add test client

Esse commit está contido em:
Daniel Molkentin
2014-07-02 10:10:22 +02:00
commit 623dfc0286
9 arquivos alterados com 245 adições e 0 exclusões
@@ -0,0 +1,22 @@
#include "socketclient.h"
SocketClient::SocketClient(QObject *parent) :
QObject(parent)
, sock(new QLocalSocket(this))
{
QString sockAddr;
#ifdef Q_OS_UNIX
sockAddr = QDir::homePath() + QLatin1String("/.local/share/data/ownCloud/");
#else
sockAddr = QLatin1String("\\\\.\\pipe\\ownCloud");
#endif
sock->connectToServer(sockAddr);
sock->open(QIODevice::ReadWrite);
connect(sock, SIGNAL(readyRead()), SLOT(writeData()));
}
void SocketClient::writeData()
{
qDebug() << sock->readAll();
}