blob: 0d84a083899d9da07e856e444add4a0f6cb15fe7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
#pragma once
#if ENABLE_CLUSTER_SYNC
#include "Runtime/Utilities/dynamic_array.h"
void* CreateZMQContext();
void DestroyZMQContext(void* context);
class MasterSocket
{
public:
MasterSocket(void* context, const char* mainUrl, const char* ctrlUrl);
~MasterSocket();
void Publish(dynamic_array<UInt8>& buffer);
bool WaitForSubscriber();
bool CheckForUnsubscribe();
bool GetAck();
private:
void* m_Context;
void* m_MainSocket;
void* m_CtrlSocket;
};
class SlaveSocket
{
public:
SlaveSocket(void* context, const char* mainUrl, const char* ctrlUrl);
~SlaveSocket();
void Listen(dynamic_array<UInt8>& buffer);
void Subscribe(int slaveId);
void Unsubscribe(int slaveId);
void SendAck();
private:
void* m_Context;
void* m_MainSocket;
void* m_CtrlSocket;
};
#endif
|