diff --git a/DOCKER_VERSION b/DOCKER_VERSION index 09b254e9..dfda3e0b 100644 --- a/DOCKER_VERSION +++ b/DOCKER_VERSION @@ -1 +1 @@ -6.0.0 +6.1.0 diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 6cd84428..31345050 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -1,6 +1,10 @@ # Changelog All notable changes to this project will be documented in this file. +## [6.1.0] - 2019-09-08 + +- move poll wrapper on top of select (only used on Windows) to the ix namespace + ## [6.0.1] - 2019-09-05 - add cobra metrics publisher + server unittest diff --git a/ixwebsocket/IXNetSystem.cpp b/ixwebsocket/IXNetSystem.cpp index e9e43f88..0c9ada18 100644 --- a/ixwebsocket/IXNetSystem.cpp +++ b/ixwebsocket/IXNetSystem.cpp @@ -34,10 +34,7 @@ namespace ix return true; #endif } -} -// This function should be in the global namespace -#ifdef _WIN32 // // That function could 'return WSAPoll(pfd, nfds, timeout);' // but WSAPoll is said to have weird behaviors on the internet @@ -47,6 +44,7 @@ namespace ix // int poll(struct pollfd *fds, nfds_t nfds, int timeout) { +#ifdef _WIN32 int maxfd = 0; fd_set readfds, writefds, errorfds; FD_ZERO(&readfds); @@ -107,5 +105,9 @@ namespace ix } return ret; - } +#else + return ::poll(fds, nfds, timeout); #endif + } + +} // namespace ix diff --git a/ixwebsocket/IXNetSystem.h b/ixwebsocket/IXNetSystem.h index 7710fe23..5b3d3ea7 100644 --- a/ixwebsocket/IXNetSystem.h +++ b/ixwebsocket/IXNetSystem.h @@ -13,11 +13,9 @@ #include #include -// Define our own poll on Windows +// Define our own poll on Windows, as a wrapper on top of select typedef unsigned long int nfds_t; -int poll(struct pollfd* fds, nfds_t nfds, int timeout); - #else #include #include @@ -35,4 +33,6 @@ namespace ix { bool initNetSystem(); bool uninitNetSystem(); + + int poll(struct pollfd* fds, nfds_t nfds, int timeout); } // namespace ix diff --git a/ixwebsocket/IXSocket.cpp b/ixwebsocket/IXSocket.cpp index ecc90dd3..62a01d52 100644 --- a/ixwebsocket/IXSocket.cpp +++ b/ixwebsocket/IXSocket.cpp @@ -79,7 +79,7 @@ namespace ix } } - int ret = ::poll(fds, nfds, timeoutMs); + int ret = ix::poll(fds, nfds, timeoutMs); PollResultType pollResult = PollResultType::ReadyForRead; if (ret < 0) diff --git a/ixwebsocket/IXWebSocketVersion.h b/ixwebsocket/IXWebSocketVersion.h index 28355fc8..03aa3a09 100644 --- a/ixwebsocket/IXWebSocketVersion.h +++ b/ixwebsocket/IXWebSocketVersion.h @@ -6,4 +6,4 @@ #pragma once -#define IX_WEBSOCKET_VERSION "6.0.0" +#define IX_WEBSOCKET_VERSION "6.1.0"