From 9229f4aea0765265b74111ea51798efde7d07997 Mon Sep 17 00:00:00 2001 From: Aaron Seigo Date: Fri, 21 Nov 2014 17:56:35 +0100 Subject: how a command accross the wire might look: initial handshake --- client/resourceaccess.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'client') 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 @@ #include "resourceaccess.h" #include "common/console.h" +#include "common/commands.h" #include #include @@ -64,7 +65,16 @@ void ResourceAccess::connected() { m_startingProcess = false; Console::main()->log(QString("Connected: %1").arg(m_socket->fullServerName())); - m_socket->write("100 command " + QString::number((long long)this).toLatin1()); + + { + const QByteArray name = QString::number((long long)this).toLatin1(); + const int commandId = Commands::HandshakeCommand; + const int dataSize = name.size(); + m_socket->write((const char*)&commandId, sizeof(int)); + m_socket->write((const char*)&dataSize, sizeof(int)); + m_socket->write(name.data(), name.size()); + } + emit ready(true); } -- cgit v1.2.3