diff options
author | Aaron Seigo <aseigo@kde.org> | 2014-11-21 17:56:35 +0100 |
---|---|---|
committer | Aaron Seigo <aseigo@kde.org> | 2014-11-21 17:56:35 +0100 |
commit | 9229f4aea0765265b74111ea51798efde7d07997 (patch) | |
tree | d779e6b619452e76bfe8daddedcc4b6b0abb98ad /client/resourceaccess.cpp | |
parent | d77a7ebbdeab5079fea31a5308fd9e1474e6336b (diff) | |
download | sink-9229f4aea0765265b74111ea51798efde7d07997.tar.gz sink-9229f4aea0765265b74111ea51798efde7d07997.zip |
how a command accross the wire might look: initial handshake
Diffstat (limited to 'client/resourceaccess.cpp')
-rw-r--r-- | client/resourceaccess.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/client/resourceaccess.cpp b/client/resourceaccess.cpp index 7c92331..2972316 100644 --- a/client/resourceaccess.cpp +++ b/client/resourceaccess.cpp | |||
@@ -1,6 +1,7 @@ | |||
1 | #include "resourceaccess.h" | 1 | #include "resourceaccess.h" |
2 | 2 | ||
3 | #include "common/console.h" | 3 | #include "common/console.h" |
4 | #include "common/commands.h" | ||
4 | 5 | ||
5 | #include <QDebug> | 6 | #include <QDebug> |
6 | #include <QProcess> | 7 | #include <QProcess> |
@@ -64,7 +65,16 @@ void ResourceAccess::connected() | |||
64 | { | 65 | { |
65 | m_startingProcess = false; | 66 | m_startingProcess = false; |
66 | Console::main()->log(QString("Connected: %1").arg(m_socket->fullServerName())); | 67 | Console::main()->log(QString("Connected: %1").arg(m_socket->fullServerName())); |
67 | m_socket->write("100 command " + QString::number((long long)this).toLatin1()); | 68 | |
69 | { | ||
70 | const QByteArray name = QString::number((long long)this).toLatin1(); | ||
71 | const int commandId = Commands::HandshakeCommand; | ||
72 | const int dataSize = name.size(); | ||
73 | m_socket->write((const char*)&commandId, sizeof(int)); | ||
74 | m_socket->write((const char*)&dataSize, sizeof(int)); | ||
75 | m_socket->write(name.data(), name.size()); | ||
76 | } | ||
77 | |||
68 | emit ready(true); | 78 | emit ready(true); |
69 | } | 79 | } |
70 | 80 | ||