Check if the clientSocket is a non-blocking socket

This commit is contained in:
2024-02-13 17:00:54 +01:00
parent 1be23a6d20
commit 7eaf236bf5

View File

@@ -270,6 +270,9 @@ void ArucoDetector::sendData(int serverSocket, const std::string& data) {
}
if(clientSocket != -1) {
setNonBlocking(clientSocket);
if(fcntl(clientSocket, F_GETFL) & O_NONBLOCK) {
std::cout << "Socket is non-blocking" << std::endl;
}
send(clientSocket, data.c_str(), data.size(), 0);
close(clientSocket);
}