Results 15 comments of zhangbo

well, I have figured out that if I call MQTTClient_destroy() before MQTT calls my connection_lost callback, it will crash. But I can't control when MQTT will call my connection_lost callback,...

we can construct acceptor obj without ip/port in crow::Server ctor, then call its open()/bind()/listen() method later in crow::Server::run(). And we also need to propogate the bind( ) failure back to...

My suggestion updated as above. Thanks !

new suggestion: use SO_EXCLUSIVEADDRUSE instead of SO_REUSEADDR on Windows. reason: https://docs.microsoft.com/en-us/windows/win32/winsock/using-so-reuseaddr-and-so-exclusiveaddruse solution(copied from https://stackoverflow.com/questions/7164879/boost-asio-why-dont-i-get-bind-address-already-in-use-in-windows-but-do-ge): ``` typedef boost::asio::detail::socket_option::boolean excluse_address; acceptor_.set_option(excluse_address(true)); ```

Maybe we can use MSVC macro "_DLL" to detect dll build vs static lib build. ``` #ifdef _WIN32 #ifdef _DLL #define WIN32_EXPORT __declspec(dllexport) #else #define WIN32_EXPORT #endif #endif ```

用MSVC编译不了,找不到llvm-config和clang lib。 error: failed to run custom build command for `libsodium-ffi v0.2.2` cargo:warning=couldn't execute `llvm-config --prefix` (error: 系统找不到指定的文件。 (os error 2)) cargo:warning=set the LLVM_CONFIG_PATH environment variable to a valid `llvm-config`...

用cargo build --no-default-features --features "trust-dns aes-cfb"编过去了。 能否在主页的README.md中加入windows编译步骤。 昨天折腾这个sodium搞了几个小时,连clang/llvm都从源码编译了一遍也没搞定。

"官方"可以给出一个标准windows环境下的编译步骤,比如win10 x64 + MSVC 2019 + vcpkg这种具体的环境。 至于其它环境下,让编译者自己搞定。

我这里用最新版的main分支的代码编译出来的lib也是这个错误,用C++、C调用都是这个错误。 原因是不能只有一个s2t.json文件,这个文件目录下的其他文件比如STPhrases.ocd2也是需要的。