이대로 제출해버릴까..

This commit is contained in:
2025-06-21 22:19:10 +09:00
parent 3a526edcf4
commit 0536f9fb11
19 changed files with 343 additions and 89 deletions

View File

@@ -2,6 +2,10 @@
namespace Network {
Socket::Socket() {
init(AF_INET, SOCK_STREAM, 0);
}
Socket::Socket(int domain, int type, int protocol) {
init(domain, type, protocol);
}
@@ -61,6 +65,8 @@ int Socket::bind(Address __addr) {
bindAddr = __addr;
int retVal = ::bind(sock, &__addr.addr, __addr.length);
if (retVal == INVALID_SOCKET) {
int err = WSAGetLastError();
spdlog::error("bind() failed: WSA error {} (0x{:X})", err, err);
spdlog::critical("bind()");
std::exit(EXIT_FAILURE);
}