mirror of
https://github.com/Telecominfraproject/wlan-cloud-lib-poco.git
synced 2025-11-03 12:07:55 +00:00
Use PollSet in SocketReactor #2092 (linux)
This commit is contained in:
@@ -72,7 +72,8 @@ public:
|
||||
{
|
||||
Poco::FastMutex::ScopedLock lock(_mutex);
|
||||
|
||||
poco_socket_t fd = socket.impl()->sockfd();
|
||||
SocketImpl* sockImpl = socket.impl();
|
||||
poco_socket_t fd = sockImpl->sockfd();
|
||||
struct epoll_event ev;
|
||||
ev.events = 0;
|
||||
if (mode & PollSet::POLL_READ)
|
||||
@@ -83,9 +84,15 @@ public:
|
||||
ev.events |= EPOLLERR;
|
||||
ev.data.ptr = socket.impl();
|
||||
int err = epoll_ctl(_epollfd, EPOLL_CTL_ADD, fd, &ev);
|
||||
if (err) SocketImpl::error();
|
||||
|
||||
_socketMap[socket.impl()] = socket;
|
||||
if (err)
|
||||
{
|
||||
if (errno == EEXIST) update(socket, mode);
|
||||
else SocketImpl::error();
|
||||
}
|
||||
|
||||
if (_socketMap.find(sockImpl) == _socketMap.end())
|
||||
_socketMap[sockImpl] = socket;
|
||||
}
|
||||
|
||||
void remove(const Socket& socket)
|
||||
|
||||
Reference in New Issue
Block a user