둘 다 동시 디버깅을 위해 push

This commit is contained in:
2025-05-03 17:58:46 +09:00
parent 4bbb6837e8
commit 6ad787eed7
11 changed files with 305 additions and 97 deletions

View File

@@ -67,6 +67,7 @@ int Socket::bind(Address __addr) {
}
int Socket::recvfrom(void *__restrict __buf, size_t __n, int __flags, struct Address& __addr) {
std::lock_guard<std::mutex> lock(readMutex);
int retVal = ::recvfrom(sock, (char*)__buf, __n, __flags, &__addr.addr, &__addr.length);
if (retVal == SOCKET_ERROR)
log::error("recvfrom()");
@@ -74,6 +75,7 @@ int Socket::recvfrom(void *__restrict __buf, size_t __n, int __flags, struct Add
}
int Socket::sendto(const void *__buf, size_t __n, int __flags, struct Address __addr) {
std::lock_guard<std::mutex> lock(writeMutex);
int retVal = ::sendto(sock, (char*)__buf, __n, __flags, &__addr.addr, __addr.length);
if (retVal == SOCKET_ERROR)
log::error("sendto()");