-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmod.cpp
More file actions
37 lines (32 loc) · 768 Bytes
/
Copy pathmod.cpp
File metadata and controls
37 lines (32 loc) · 768 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
34
35
36
37
#include "ctk-0.40/mod.hpp"
#ifdef CBS_LINUX
#include <netdb.h>
#include <poll.h>
#include <openssl/ssl.h>
#include <openssl/err.h>
#endif
#include "mod.hpp"
namespace wtk {
#include "json/json.cpp"
#ifdef CBS_LINUX
void make_socket_nonblocking(int socket_fd) {
int flags = ::fcntl(socket_fd, F_GETFL, 0);
if (flags == -1) {
WTK_PANIC("::fcntl(F_GETFL) failed");
}
if (::fcntl(socket_fd, F_SETFL, flags | O_NONBLOCK) == -1) {
WTK_PANIC("::fcntl(F_SETFL) failed");
}
}
#include "addr/addr.cpp"
#include "socket/server/server.cpp"
#include "socket/client/client.cpp"
#include "http/http.cpp"
#include "websocket/websocket.cpp"
void init() {
::SSL_library_init();
::OpenSSL_add_all_algorithms();
::SSL_load_error_strings();
}
#endif
}