clsocket icon indicating copy to clipboard operation
clsocket copied to clipboard

CPassiveSocket::Listen() behaves different on Windows

Open hayguen opened this issue 4 years ago • 0 comments

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.

hayguen avatar Aug 12 '20 14:08 hayguen