arpadboda 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_r408869191
##########
File path: extensions/coap/COAPLoader.cpp
##########
@@ -16,9 +16,36 @@
* limitations under the License.
*/
#include "core/FlowConfiguration.h"
+#include "core/logging/LoggerConfiguration.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);
+ if (iWinSockInitResult != 0) {
+
logging::LoggerFactory<COAPObjectFactoryInitializer>::getLogger()->log_error("WSAStartup
failed with error %d", iWinSockInitResult);
+ return false;
+ } else {
Review comment:
Be removing the else (which is fine because of the return above) we can
also remove the else part of the ifdef, but it's just fancy, this should work
fine.
----------------------------------------------------------------
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