Ignore:
Timestamp:
12/21/22 14:54:01 (17 months ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
Phase:
public
Message:

SO_REUSEADDR is enabled for TCP sockets

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/hu/varadiistvan/scpl/io/_win32/TCPServerSocket.cc

    r30 r39  
    5050    sin.sin_port = htons(port);
    5151
     52    int reuse = 1;
     53    if (WSAInterface::get().setsockopt(handle, SOL_SOCKET, SO_REUSEADDR,
     54                                       reinterpret_cast<const char*>(&reuse),
     55                                       sizeof(reuse))<0) {
     56        printf("TCPServerSocket: setsockopt(SO_REUSEADDR) failed\n");
     57    }
     58
    5259    if (WSAInterface::get().bind(handle,
    5360                                 reinterpret_cast<struct sockaddr*>(&sin), sizeof(sin))<0) {
Note: See TracChangeset for help on using the changeset viewer.