mirror of
https://github.com/modelec/detection_pot.git
synced 2026-01-19 00:57:28 +01:00
Check if the clientSocket is a non-blocking socket
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user