This commit is contained in:
2025-05-09 21:47:00 +09:00
parent 78f2bfe2f6
commit 0aa312f67e
6 changed files with 41 additions and 59 deletions

View File

@@ -15,6 +15,8 @@ IOCP::~IOCP() {
void IOCP::destruct() {
#ifdef __linux__
uint64_t u = 1;
::write(epollDetroyerFd_, &u, sizeof(uint64_t));
close(epollfd_);
#endif
}

View File

@@ -32,8 +32,11 @@ int TCPSocket::connect(Address& serveraddr) {
int TCPSocket::recv(void *__restrict __buf, size_t __n, int __flags) {
int retVal = ::recv(sock, (char *)__buf, __n, __flags);
if (retVal == SOCKET_ERROR)
if (retVal == SOCKET_ERROR) {
if (errno == EAGAIN || errno == EWOULDBLOCK)
return retVal;
log::error("recv()");
}
return retVal;
}