diff --git a/Net/include/Poco/Net/Socket.h b/Net/include/Poco/Net/Socket.h index ba90d23f8..e362772dc 100644 --- a/Net/include/Poco/Net/Socket.h +++ b/Net/include/Poco/Net/Socket.h @@ -130,6 +130,7 @@ public: void close(); /// Closes the socket. + //@deprecated static int select(SocketList& readList, SocketList& writeList, SocketList& exceptList, const Poco::Timespan& timeout); /// Determines the status of one or more sockets, /// using a call to select(). @@ -159,6 +160,9 @@ public: /// the closed socket will not be included in any list. /// In this case, the return value may be greater than the sum /// of all sockets in all list. + /// + /// This function is deprecated and may be removed in the future releases, + /// please use PollSet class instead. bool poll(const Poco::Timespan& timeout, int mode) const; /// Determines the status of the socket, using a diff --git a/Net/src/Socket.cpp b/Net/src/Socket.cpp index df50960ad..9fc8371e5 100644 --- a/Net/src/Socket.cpp +++ b/Net/src/Socket.cpp @@ -219,12 +219,14 @@ int Socket::select(SocketList& readList, SocketList& writeList, SocketList& exce SocketList readyExceptList; for (int n = 0; n < rc; ++n) { - if (eventsOut[n].events & EPOLLERR) - readyExceptList.push_back(*reinterpret_cast(eventsOut[n].data.ptr)); + Socket sock = *reinterpret_cast(eventsOut[n].data.ptr); + if ((eventsOut[n].events & EPOLLERR) && + (std::end(exceptList) != std::find(exceptList.begin(), exceptList.end(), sock))) + readyExceptList.push_back(sock); if (eventsOut[n].events & EPOLLIN) - readyReadList.push_back(*reinterpret_cast(eventsOut[n].data.ptr)); + readyReadList.push_back(sock); if (eventsOut[n].events & EPOLLOUT) - readyWriteList.push_back(*reinterpret_cast(eventsOut[n].data.ptr)); + readyWriteList.push_back(sock); } std::swap(readList, readyReadList); std::swap(writeList, readyWriteList);