-
Notifications
You must be signed in to change notification settings - Fork 30
Socket timeout implementation and tests #1018
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
Conversation
|
Implemented socket timeout for |
bricks/net/tcp/impl/posix.h
Outdated
|
|
||
| CURRENT_BRICKS_NET_LOG("S%05d connect() ...\n", static_cast<SOCKET>(socket)); | ||
|
|
||
| setsockopt(socket, SOL_SOCKET, SO_RCVTIMEO, &read_timeout, sizeof(read_timeout)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe skip these calls if the {read,write}_timeout are at their default value? To not change the behavior at all. Who knows what other OSes and/or platforms can do with these seemingly benign calls?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, will add default a 0,0 and block
if (*_timeout.s > 0 || *_timeout.u > 0) {
setsockopt(...)
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, ready to merge
No description provided.