mirror of
https://github.com/ruby/ruby.git
synced 2025-09-15 08:33:58 +02:00
Add IO#timeout attribute and use it for blocking IO operations. (#5653)
This commit is contained in:
parent
e76217a7f3
commit
e4f91bbdba
Notes:
git
2022-10-07 17:49:02 +09:00
Merged-By: ioquatix <samuel@codeotaku.com>
17 changed files with 428 additions and 99 deletions
|
@ -1285,7 +1285,7 @@ bsock_sendmsg_internal(VALUE sock, VALUE data, VALUE vflags,
|
|||
|
||||
if (ss == -1) {
|
||||
int e;
|
||||
if (!nonblock && rb_io_maybe_wait_writable(errno, fptr->self, Qnil)) {
|
||||
if (!nonblock && rb_io_maybe_wait_writable(errno, fptr->self, fptr->timeout)) {
|
||||
rb_io_check_closed(fptr);
|
||||
goto retry;
|
||||
}
|
||||
|
@ -1557,7 +1557,7 @@ bsock_recvmsg_internal(VALUE sock,
|
|||
|
||||
if (ss == -1) {
|
||||
int e;
|
||||
if (!nonblock && rb_io_maybe_wait_readable(errno, fptr->self, Qnil)) {
|
||||
if (!nonblock && rb_io_maybe_wait_readable(errno, fptr->self, fptr->timeout)) {
|
||||
rb_io_check_closed(fptr);
|
||||
goto retry;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue