Fix up sync version to new protocol

This commit is contained in:
Chris Marsh
2017-07-10 15:25:47 -07:00
parent 2a31affb81
commit f41137e5cf
4 changed files with 45 additions and 9 deletions

View File

@ -4,16 +4,24 @@
#include <stdint.h>
enum class OPCODE : uint32_t {
HANDSHAKE = 0,
FRAME = 1,
CLOSE = 2,
};
struct RpcMessageFrame {
OPCODE opcode;
uint32_t length;
char message[64 * 1024 - sizeof(uint32_t)];
char message[64 * 1024 - 8];
};
struct RpcConnection {
void (*onConnect)() = nullptr;
void (*onDisconnect)() = nullptr;
char appId[64];
static RpcConnection* Create();
static RpcConnection* Create(const char* applicationId);
static void Destroy(RpcConnection*&);
void Open();
void Close();