Skip to content

Commit

Permalink
Code comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
ioquatix committed Aug 29, 2023
1 parent 11d8bb2 commit b7954d6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/io/event/selector/select.rb
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,9 @@ def io_write(fiber, io, buffer, length, offset = 0)
elsif Support.fiber_scheduler_v1?
# Ruby <= 3.1, limited IO::Buffer support.
def io_read(fiber, _io, buffer, length, offset = 0)
# We need to avoid any internal buffering, so we use a duplicated IO object:
io = IO.for_fd(_io.fileno, autoclose: false)

total = 0

maximum_size = buffer.size - offset
Expand Down Expand Up @@ -321,7 +323,9 @@ def io_read(fiber, _io, buffer, length, offset = 0)
end

def io_write(fiber, _io, buffer, length, offset = 0)
# We need to avoid any internal buffering, so we use a duplicated IO object:
io = IO.for_fd(_io.fileno, autoclose: false)

total = 0

maximum_size = buffer.size - offset
Expand Down

0 comments on commit b7954d6

Please sign in to comment.