mirror of
https://github.com/pocoproject/poco.git
synced 2024-12-14 19:13:49 +01:00
fix(PollSet): windows fixes
This commit is contained in:
parent
b175a8de7a
commit
03561df128
@ -462,7 +462,7 @@ private:
|
||||
|
||||
inline void SocketProactor::addSocket(Socket sock, int mode)
|
||||
{
|
||||
_pollSet.add(sock, mode);
|
||||
_pollSet.add(sock, mode | PollSet::POLL_ERROR);
|
||||
}
|
||||
|
||||
|
||||
|
@ -613,8 +613,8 @@ int SocketImpl::available()
|
||||
#if (POCO_OS != POCO_OS_LINUX)
|
||||
if (type() == SOCKET_TYPE_DATAGRAM)
|
||||
{
|
||||
char buf[result];
|
||||
result = recvfrom(sockfd(), buf, result, MSG_PEEK, NULL, NULL);
|
||||
std::vector<char> buf(result);
|
||||
result = recvfrom(sockfd(), &buf[0], result, MSG_PEEK, NULL, NULL);
|
||||
}
|
||||
#endif
|
||||
return result;
|
||||
|
@ -300,13 +300,13 @@ int SocketProactor::poll(int* pHandled)
|
||||
if (it->second & PollSet::POLL_READ)
|
||||
{
|
||||
Socket sock = it->first;
|
||||
if (hasHandlers(_readHandlers, sock.impl()->sockfd()))
|
||||
if (hasHandlers(_readHandlers, static_cast<int>(sock.impl()->sockfd())))
|
||||
handled += receive(sock);
|
||||
}
|
||||
if (it->second & PollSet::POLL_WRITE)
|
||||
{
|
||||
Socket sock = it->first;
|
||||
if (hasHandlers(_writeHandlers, sock.impl()->sockfd()))
|
||||
if (hasHandlers(_writeHandlers, static_cast<int>(sock.impl()->sockfd())))
|
||||
handled += send(sock);
|
||||
}
|
||||
if (it->second & PollSet::POLL_ERROR)
|
||||
|
@ -195,8 +195,8 @@ void PollSetTest::testPollNoServer()
|
||||
ss2.connectNB(SocketAddress("127.0.0.1", 0xFEFF));
|
||||
PollSet ps;
|
||||
assertTrue(ps.empty());
|
||||
ps.add(ss1, PollSet::POLL_READ);
|
||||
ps.add(ss2, PollSet::POLL_READ);
|
||||
ps.add(ss1, PollSet::POLL_READ | PollSet::POLL_ERROR);
|
||||
ps.add(ss2, PollSet::POLL_READ | PollSet::POLL_ERROR);
|
||||
assertTrue(!ps.empty());
|
||||
assertTrue(ps.has(ss1));
|
||||
assertTrue(ps.has(ss2));
|
||||
|
Loading…
Reference in New Issue
Block a user