szaszm commented on a change in pull request #687: MINIFICPP-1092 - Make CoAP
compile and work on Windows
URL: https://github.com/apache/nifi-minifi-cpp/pull/687#discussion_r365899725
##########
File path: extensions/coap/COAPLoader.cpp
##########
@@ -18,7 +18,28 @@
#include "core/FlowConfiguration.h"
#include "COAPLoader.h"
+#ifdef WIN32
+#include <winsock2.h>
+#endif
+
bool COAPObjectFactory::added =
core::FlowConfiguration::add_static_func("createCOAPFactory");
+
+bool COAPObjectFactoryInitializer::initialize() {
+#ifdef WIN32
+ static WSADATA s_wsaData;
+ int iWinSockInitResult = WSAStartup(MAKEWORD(2, 2), &s_wsaData);
Review comment:
Did you consider logging the issue in case of failed `WSAStartup`?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services