From 335069787563e81e78e75827128cf0cc1d5f5da4 Mon Sep 17 00:00:00 2001 From: Ryzerth Date: Fri, 30 Jul 2021 22:06:06 +0200 Subject: [PATCH] Fixed broken code on linux --- core/src/utils/networking.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/core/src/utils/networking.cpp b/core/src/utils/networking.cpp index 7f8f792b..8b5b8f72 100644 --- a/core/src/utils/networking.cpp +++ b/core/src/utils/networking.cpp @@ -68,7 +68,7 @@ namespace net { int ret; if (_udp) { - int fromLen = sizeof(remoteAddr); + socklen_t fromLen = sizeof(remoteAddr); ret = recvfrom(_sock, (char*)buf, count, 0, (struct sockaddr*)&remoteAddr, &fromLen); } else { @@ -212,7 +212,11 @@ namespace net { // Accept socket _sock = ::accept(sock, NULL, NULL); +#ifdef _WIN32 if (_sock < 0 || _sock == SOCKET_ERROR) { +#else + if (_sock < 0) { +#endif listening = false; throw std::runtime_error("Could not bind socket"); return NULL; @@ -451,7 +455,6 @@ namespace net { } } - return Conn(new ConnClass(sock, raddr, true)); } } \ No newline at end of file