Check if the clientSocket open well

This commit is contained in:
2024-02-13 17:05:36 +01:00
parent 2321b5adf3
commit 69eb4b30f3

View File

@@ -267,6 +267,7 @@ void ArucoDetector::setNonBlocking(int sockfd) {
void ArucoDetector::sendData(int serverSocket, const std::string& data) {
std::cout << "Sending Data" << std::endl;
int clientSocket = accept(serverSocket, nullptr, nullptr);
std::cout << "Client Socket: " << clientSocket << std::endl;
if(clientSocket == -1 && errno != EWOULDBLOCK && errno != EAGAIN) {
perror("accept");
return;