diff --git a/Environment-Test-Dockerfile b/Environment-Test-Dockerfile index 70d370d..12f4d28 100644 --- a/Environment-Test-Dockerfile +++ b/Environment-Test-Dockerfile @@ -26,9 +26,6 @@ COPY ./src ./src COPY ./tests ./tests COPY ./CMakeLists.txt ./CMakeLists.txt -# Do a fake copy to make sure it runs both stages -COPY --from=alpine /alpine/build/test/CppSocketLibraryTests /ubuntu/CppSocketLibraryTests - RUN ["cmake", "-B", "build", "."] WORKDIR /ubuntu/build @@ -36,3 +33,6 @@ RUN ["make", "all"] WORKDIR /ubuntu/build/tests RUN ["./CppSocketLibraryTests"] + +# Do a fake copy to make sure it runs both stages +COPY --from=alpine /alpine/build/tests/CppSocketLibraryTests /ubuntu/CppSocketLibraryTests diff --git a/src/socket/UDPSocket.cpp b/src/socket/UDPSocket.cpp index ecbd509..c4f3e43 100644 --- a/src/socket/UDPSocket.cpp +++ b/src/socket/UDPSocket.cpp @@ -225,9 +225,13 @@ namespace kt int UDPSocket::pollSocket(SOCKET socket, const long& timeout) const { + if (kt::isInvalidSocket(socket)) + { + return -1; + } + timeval timeOutVal{}; int res = kt::pollSocket(socket, timeout, &timeOutVal); - return res; }