Created
April 12, 2017 12:29
-
-
Save shimomura1004/c8800361b26593dfa8fb794158e535ae to your computer and use it in GitHub Desktop.
fluentd sender sample with Qt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <QGuiApplication> | |
#include <QQmlApplicationEngine> | |
#include <QDebug> | |
#include <qmsgpack/msgpack.h> | |
#include <QTcpSocket> | |
int main(int argc, char *argv[]) | |
{ | |
QVariantMap log; | |
log.insert("status", "error"); | |
QVariantList list; | |
list << "hoge.debug" << 12345 << log; | |
QByteArray array = MsgPack::pack(list); | |
qDebug() << array; | |
QTcpSocket socket; | |
socket.connectToHost("localhost", 24224); | |
socket.waitForConnected(10000); | |
socket.write(array); | |
socket.waitForBytesWritten(10000); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment