자잘한 수정, 이제 다른 소켓으로 쓰기 요청 할 수 있을 듯

This commit is contained in:
2025-05-03 13:59:04 +09:00
parent 181d30ff28
commit f765c163bf
12 changed files with 512 additions and 310 deletions

View File

@@ -80,12 +80,24 @@ int Socket::sendto(const void *__buf, size_t __n, int __flags, struct Address __
return retVal;
}
Socket::Socket(const Socket& other_) {
memcpy(this, &other_, sizeof(Socket));
valid_ = false;
}
Socket::Socket(Socket &&other_) noexcept {
other_.valid_ = false;
memcpy(this, &other_, sizeof(Socket));
valid_ = true;
}
Socket& Socket::operator=(const Socket& other_) {
memcpy(this, &other_, sizeof(Socket));
valid_ = false;
return *this;
}
Socket& Socket::operator=(Socket && other_) noexcept {
other_.valid_ = false;
memcpy(this, &other_, sizeof(Socket));