룸 내의 유저만 조회 기능 추가

This commit is contained in:
2025-05-10 17:40:58 +09:00
parent 91a3cfd9f4
commit 7c382bead0
5 changed files with 131 additions and 21 deletions

View File

@@ -151,9 +151,11 @@ public:
return;
}
else {
spdlog::error("recv() [{}]", strerror(errno));
rootIocpData->event = IOCPEVENT::QUIT;
spdlog::debug("Disconnected. [{}]", (std::string)(rootIocpData->socket->remoteAddr));
::epoll_ctl(epollfd, EPOLL_CTL_DEL, rootIocpData->socket->sock, NULL);
delete rootIocpData;
threadPool->enqueueJob(callback, rootIocpData);
// delete rootIocpData;
return;
}
}
@@ -168,9 +170,11 @@ public:
redSize = ptr->socket->recv(ptr->buf + totalRedSize, headerSize - totalRedSize, 0);
if (redSize == SOCKET_ERROR) {
spdlog::error("recv() [{}]", strerror(errno));
ptr->event = IOCPEVENT::QUIT;
spdlog::debug("Disconnected. [{}]", (std::string)(ptr->socket->remoteAddr));
::epoll_ctl(epollfd, EPOLL_CTL_DEL, ptr->socket->sock, NULL);
delete ptr;
threadPool->enqueueJob(callback, ptr);
// delete ptr;
return;
}
else if (redSize == 0) {
@@ -198,9 +202,11 @@ public:
spdlog::trace("No data to read on {}", tid);
return;
}
spdlog::error("recv() [{}]", strerror(errno));
ptr->event = IOCPEVENT::QUIT;
spdlog::debug("Disconnected. [{}]", (std::string)(ptr->socket->remoteAddr));
::epoll_ctl(epollfd, EPOLL_CTL_DEL, ptr->socket->sock, NULL);
delete ptr;
threadPool->enqueueJob(callback, ptr);
// delete ptr;
return;
}
else if (redSize == 0) {