PROJECT(usocket)
cmake_minimum_required(VERSION 2.6)
set(CMAKE_CXX_COMPILER "g++")
SET(LIB_SRC
./src/socket.c
./src/eventing/libuv.c
./src/eventing/epoll_kqueue.c
./src/eventing/gcd.c
./src/crypto/wolfssl.c
./src/crypto/openssl.c
&...
uSockets, uWebSockets阅读全文
void *us_loop_ext(struct us_loop_t *loop) {
return loop + 1;
}
void *us_socket_ext(int ssl, struct us_socket_t *s) {
#ifndef LIBUS_NO_SSL
if (ssl) {
return us_internal_ssl_socket_ext((struct us_internal_ssl_socket_t *) s);
}
#endif
return s + 1;
}
void *us_i...
uSockets, uWebSockets, 网络编程阅读全文
uSockets主要数据结构:
struct us_poll_t {
uv_poll_t uv_p;
LIBUS_SOCKET_DESCRIPTOR fd;//这个其实就是把平台摸平了的fd
unsigned char poll_type;
};
/* Internal callback types are polls just like sockets */
struct us_internal_callback_t {
alignas(LIBUS_EXT_ALIGNMENT) struct us_poll_t p;
struct us...
uSockets, uWebSockets, 网络编程阅读全文
最近在学习websockets的库,cpp主要有三个,websocketpp/libwebsockets/uwebsockets.看了一下简单明了的就是uWebSockets了,但是这个代码写的确实有点抽象。。。不太像我的风格。websocketpp要boost,有点巨大,不想用,libwebsockets虽然是c的,但是它的samples写的太磋,不太想用。纠结来纠结去还是用uWebSockets了,网址:https://github.com/uNetworking/uWebSockets uWebSockets依赖uSockets: https://github...
uSockets, uWebSockets, 网络编程阅读全文