이대로 제출해버릴까..
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user