Skip to content

Commit 6a3ffcb

Browse files
author
Benjamin Sergeant
committed
move poll wrapper on top of select (only used on Windows) to the ix namespace
1 parent 260a94d commit 6a3ffcb

File tree

6 files changed

+16
-10
lines changed

6 files changed

+16
-10
lines changed

DOCKER_VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
6.0.0
1+
6.1.0

docs/CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# Changelog
22
All notable changes to this project will be documented in this file.
33

4+
## [6.1.0] - 2019-09-08
5+
6+
- move poll wrapper on top of select (only used on Windows) to the ix namespace
7+
48
## [6.0.1] - 2019-09-05
59

610
- add cobra metrics publisher + server unittest

ixwebsocket/IXNetSystem.cpp

+6-4
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,7 @@ namespace ix
3434
return true;
3535
#endif
3636
}
37-
}
3837

39-
// This function should be in the global namespace
40-
#ifdef _WIN32
4138
//
4239
// That function could 'return WSAPoll(pfd, nfds, timeout);'
4340
// but WSAPoll is said to have weird behaviors on the internet
@@ -47,6 +44,7 @@ namespace ix
4744
//
4845
int poll(struct pollfd *fds, nfds_t nfds, int timeout)
4946
{
47+
#ifdef _WIN32
5048
int maxfd = 0;
5149
fd_set readfds, writefds, errorfds;
5250
FD_ZERO(&readfds);
@@ -107,5 +105,9 @@ namespace ix
107105
}
108106

109107
return ret;
110-
}
108+
#else
109+
return ::poll(fds, nfds, timeout);
111110
#endif
111+
}
112+
113+
} // namespace ix

ixwebsocket/IXNetSystem.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,9 @@
1313
#include <io.h>
1414
#include <ws2def.h>
1515

16-
// Define our own poll on Windows
16+
// Define our own poll on Windows, as a wrapper on top of select
1717
typedef unsigned long int nfds_t;
1818

19-
int poll(struct pollfd* fds, nfds_t nfds, int timeout);
20-
2119
#else
2220
#include <arpa/inet.h>
2321
#include <errno.h>
@@ -35,4 +33,6 @@ namespace ix
3533
{
3634
bool initNetSystem();
3735
bool uninitNetSystem();
36+
37+
int poll(struct pollfd* fds, nfds_t nfds, int timeout);
3838
} // namespace ix

ixwebsocket/IXSocket.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ namespace ix
7979
}
8080
}
8181

82-
int ret = ::poll(fds, nfds, timeoutMs);
82+
int ret = ix::poll(fds, nfds, timeoutMs);
8383

8484
PollResultType pollResult = PollResultType::ReadyForRead;
8585
if (ret < 0)

ixwebsocket/IXWebSocketVersion.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66

77
#pragma once
88

9-
#define IX_WEBSOCKET_VERSION "6.0.0"
9+
#define IX_WEBSOCKET_VERSION "6.1.0"

0 commit comments

Comments
 (0)