We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I am using function read_all() but process is blocking. I find this happen here: int read_bytes = read(fd, buf + rbytes, read_upto - rbytes);
Solution:
fd_set fds; struct timeval timeout; timeout.tv_sec = 3; /* timeout in secs */ timeout.tv_usec = 10000; FD_ZERO(&fds); FD_SET(fd, &fds); if (select(fd + 1, &fds, NULL, NULL, &timeout) > 0) { read_bytes = read(fd, buf + rbytes, read_upto - rbytes); } else { std::cout << "Time out" << std::endl; }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I am using function read_all() but process is blocking.
I find this happen here:
int read_bytes = read(fd, buf + rbytes, read_upto - rbytes);
Solution:
The text was updated successfully, but these errors were encountered: