Closed veggiesaurus closed 3 years ago
The last master branch 0.15.6 is not lib.so any more. The branch 0.15.6 is header only api which rely on uSocket. This means we need lot of modification about building. At least the dependency of libuv or epoll need to be addressed.
this shouldn't be too hard to change. uSocket is a pretty minor dependency
Hello,
New code is header only (just include it) and cross-platform C (without any dependencies) with optionally OpenSSL and zlib as dependencies. Windows is the only platform which need libuv
Hello,
New code is header only (just include it) and cross-platform C (without any dependencies) with optionally OpenSSL and zlib as dependencies. Windows is the only platform which need libuv
@alexhultman thanks for the info!
Do we need to include uWebSockets
in submodules?
Do we need to include
uWebSockets
in submodules?
that's probably a good idea. However, we first need to check if the backend can work nicely with C++17 compilers. I'm a bit concerned about RedHat support in that regard.
I have created a test branch mark/upgrade_uWebSockets, which applies the latest version of uWebSockets. In the new uWebSockets, the libuv
is wrapped in the submodule uSockets
. Since it lacks detailed instruction on how to apply the async mechanism for our needs. The current solution is to slightly modify the uSockets
(as well as uWebSockets
) in order to access the uv loop
directly. The installation script for the modified version of uWebSockets
is here. Modifying the uWebSockets maybe not a good way, unless there is a significant improvement of the performance (it needs tests). I will keep understanding the new websockets code and try to avoid changing it.
I suggest you contact the uWebSockets author for details on how to do this upgrade and handle our async code
I think I found the solution. According to #1050 from the uWebSockets repo. We can use uWS::Loop::defer(function)
to send websockets messages. I have changed the code and it works fine. So we don't need to modify the uSockets and uWebSockets.
uWS::Loop::get() can be directly cast to uv_loop_t if you are compiling for libuv. But you can also use defer as a wrapper around uv_async_t
uWS::Loop::get() can be directly cast to uv_loop_t if you are compiling for libuv. But you can also use defer as a wrapper around uv_async_t
@alexhultman Thank you for the suggestion! And your great work!
The latest version of uWebSockets has some performance improvements and removes the use of deprecated OpenSSL functions. We should migrate to this version (0.15.6 as of time of writing)
The API has changed quite a bit, but our use of the API itself is quite limited, so this shouldn't be too much of an issue.