DDNet documentation
Loading...
Searching...
No Matches
websockets.h
Go to the documentation of this file.
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// NOLINTBEGIN(readability-identifier-naming)
17int websocket_create(const NETADDR *bindaddr);
18void websocket_destroy(int socket);
19int websocket_recv(int socket, unsigned char *data, size_t maxsize, NETADDR *addr);
20int websocket_send(int socket, const unsigned char *data, size_t size, const NETADDR *addr);
21int websocket_fd_set(int socket, fd_set *set);
22int websocket_fd_get(int socket, fd_set *set);
23// NOLINTEND(readability-identifier-naming)
24
25#endif // ENGINE_SHARED_WEBSOCKETS_H
Definition types.h:168
void websocket_init()
int websocket_send(int socket, const unsigned char *data, size_t size, const NETADDR *addr)
int websocket_fd_set(int socket, fd_set *set)
int websocket_recv(int socket, unsigned char *data, size_t maxsize, NETADDR *addr)
void websocket_destroy(int socket)
int websocket_fd_get(int socket, fd_set *set)
int websocket_create(const NETADDR *bindaddr)