-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
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
Add in Driver Timeout Architecture #511
Comments
How To Accomplish this:This can be accomplished fairly accurately using the Send Implementation Pseudocode (Assuming Non-Blocking Socket)status send(int fd, char* bytes, int size, int timeout) {
int rc = 0;
int sent = 0;
start = getTime(); // F´ time if possible
while ((rc >= 0 and sent < size) or ((rc == -1) and errnno == EINTER || ... EAGAIN || ... EWOULDBLOCK ) {
remaining_timeout = getTime() - start;
rc = select(..., fd, ..., remaining_timeout );
if (errno == TIMEOUT) {
return TIMEOUT;
}
rc = send(fd, bytes + sent, size - sent)
if (rc > 0) {
sent += rc;
}
}
return (sent == size) ? SUCCESS : ERROR;
}
|
ported static assert from lunarflashlight and neasc
Suggested Enhancements:
Additional Features to Consider:
Testing Considerations:
Configuration:
|
Feature Description
Currently there are no good ways to limit
send
andrecv
calls to a specific amount of time. This can be done, but should be done in a generic way that works for all driver types that implement theByteStreamDriver
interface.Rationale
Calls to
send
andrecvPoll
should have a configurable timeout to prevent excessive time being spent in these calls.The text was updated successfully, but these errors were encountered: