-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathlibrary.h
More file actions
33 lines (27 loc) · 1011 Bytes
/
library.h
File metadata and controls
33 lines (27 loc) · 1011 Bytes
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
#ifndef WebSocketAsio_LIBRARY_H
#define WebSocketAsio_LIBRARY_H
#include <cinttypes>
#define EXPORT extern "C" __declspec(dllexport)
#if _WIN32 || _WIN64
#if _WIN64
#define ENVIRONMENT64
#define ARCH_LABEL "x64"
#else
#define ENVIRONMENT32
#define ARCH_LABEL "x86"
#endif
#endif
typedef void (*on_connect_t)();
typedef void (*on_fail_t)(const wchar_t* from);
typedef void (*on_disconnect_t)();
typedef void (*on_data_t)(const wchar_t*, size_t);
EXPORT void enable_verbose(intptr_t enabled);
EXPORT size_t websocket_connect(const wchar_t *szServer);
EXPORT size_t websocket_disconnect();
EXPORT size_t websocket_send(const wchar_t *szMessage, size_t dwLen, bool isBinary);
EXPORT size_t websocket_isconnected();
EXPORT size_t websocket_register_on_connect_cb(size_t dwAddress);
EXPORT size_t websocket_register_on_fail_cb(size_t dwAddress);
EXPORT size_t websocket_register_on_disconnect_cb(size_t dwAddress);
EXPORT size_t websocket_register_on_data_cb(size_t dwAddress);
#endif //WebSocketAsio_LIBRARY_H