mirror of
https://github.com/momo5502/emulator.git
synced 2026-01-18 11:13:57 +00:00
Reuse address
This commit is contained in:
@@ -7,7 +7,7 @@ using namespace std::literals;
|
||||
|
||||
namespace network
|
||||
{
|
||||
socket::socket(SOCKET s)
|
||||
socket::socket(const SOCKET s)
|
||||
: socket_(s)
|
||||
{
|
||||
}
|
||||
@@ -23,6 +23,10 @@ namespace network
|
||||
setsockopt(this->socket_, IPPROTO_IPV6, IPV6_V6ONLY, reinterpret_cast<char*>(&i),
|
||||
static_cast<int>(sizeof(i)));
|
||||
}
|
||||
|
||||
int optval = 1;
|
||||
setsockopt(this->socket_, SOL_SOCKET, SO_REUSEADDR, reinterpret_cast<char*>(&optval),
|
||||
static_cast<int>(sizeof(optval)));
|
||||
}
|
||||
|
||||
socket::~socket()
|
||||
|
||||
Reference in New Issue
Block a user