[#68845] [Ruby trunk - Feature #11056] [PATCH] lib/net/*: use io/wait methods instead of IO.select — normalperson@...
Issue #11056 has been updated by Eric Wong.
3 messages
2015/04/11
[#68945] [Ruby trunk - Feature #11083] [Open] Gemify net-telnet — shibata.hiroshi@...
Issue #11083 has been reported by Hiroshi SHIBATA.
4 messages
2015/04/21
[#68951] Re: [Ruby trunk - Feature #11083] [Open] Gemify net-telnet
— Eric Wong <normalperson@...>
2015/04/21
shibata.hiroshi@gmail.com wrote:
[#69012] [Ruby trunk - Feature #11105] [Open] ES6-like hash literals — shugo@...
Issue #11105 has been reported by Shugo Maeda.
5 messages
2015/04/29
[ruby-core:68952] Re: [Ruby trunk - Feature #11081] [Open] [PATCH] stdlib: use IO#wait_*able instead of IO.select when possible
From:
Eric Wong <normalperson@...>
Date:
2015-04-21 17:38:44 UTC
List:
ruby-core #68952
Also, this (untested) patch. I forgot the "::" style calling convention
when checking for IO.select callers.
diff --git a/lib/net/telnet.rb b/lib/net/telnet.rb
index 2260e7f..3c4099c 100644
--- a/lib/net/telnet.rb
+++ b/lib/net/telnet.rb
@@ -11,6 +11,7 @@
require "net/protocol"
require "English"
+require "io/wait"
module Net
@@ -552,8 +553,8 @@ module Net
line = ''
buf = ''
rest = ''
- until(prompt === line and not IO::select([@sock], nil, nil, waittime))
- unless IO::select([@sock], nil, nil, time_out)
+ until(prompt === line and not @sock.wait_readable(waittime))
+ unless @sock.wait_readable(time_out)
raise Net::ReadTimeout, "timed out while waiting for more data"
end
begin
@@ -610,7 +611,7 @@ module Net
def write(string)
length = string.length
while 0 < length
- IO::select(nil, [@sock])
+ @sock.wait_writable
@dumplog.log_dump('>', string[-length..-1]) if @options.has_key?("Dump_log")
length -= @sock.syswrite(string[-length..-1])
end