| 1 | #ifndef ENGINE_SHARED_WEBSOCKETS_H |
| 2 | #define ENGINE_SHARED_WEBSOCKETS_H |
| 3 | |
| 4 | #include <base/detect.h> |
| 5 | #include <base/types.h> |
| 6 | |
| 7 | #if defined(CONF_FAMILY_UNIX) |
| 8 | #include <sys/select.h> |
| 9 | #elif defined(CONF_FAMILY_WINDOWS) |
| 10 | #include <winsock2.h> |
| 11 | #endif |
| 12 | |
| 13 | #include <cstddef> |
| 14 | |
| 15 | void websocket_init(); |
| 16 | int websocket_create(const NETADDR *bindaddr); |
| 17 | void websocket_destroy(int socket); |
| 18 | int websocket_recv(int socket, unsigned char *data, size_t maxsize, NETADDR *addr); |
| 19 | int websocket_send(int socket, const unsigned char *data, size_t size, const NETADDR *addr); |
| 20 | int websocket_fd_set(int socket, fd_set *set); |
| 21 | int websocket_fd_get(int socket, fd_set *set); |
| 22 | |
| 23 | #endif // ENGINE_SHARED_WEBSOCKETS_H |
| 24 | |