I see different examples.
Do I need to close both sockets or only the first one if I dont need them anymore?
Code:if ((sock2 = accept(Sock1, (struct sockaddr *)&ClientAddr, &paddr_sz)) == INVALID_SOCKET) { printf("Accept error = %d", WSAGetLastError()); closesocket(Sock1); return 1; } ... //Close the socket cleanly closesocket(sock2); closesocket(Sock1);




Reply With Quote