clsocket
clsocket copied to clipboard
CPassiveSocket::Listen() behaves different on Windows
On Windows,
SETSOCKOPT(m_socket, SOL_SOCKET, SO_REUSEADDR, (char*)&nReuse, sizeof(int32));
SETSOCKOPT(m_socket, IPPROTO_TCP, IP_TOS, &nReuse, sizeof(int32));
is NOT executed, where especially setting SO_REUSEADDR leads to different behaviour, when closing listening socket .. and trying to listen again within a few seconds.
same behaviour could be achieved, when always calling
CSimpleSocket::SetOptionReuseAddr()
always inside Listen() - as alternative, have it called from outside before calling Listen() - if desired.
The same issue also for IPPROTO_TCP / IP_TOS but this function is missing in CSimpleSocket - for now.