22件ヒット
[1-22件を表示]
(0.041秒)
検索結果
先頭2件
-
Kernel
. # select(reads , writes = [] , excepts = [] , timeout = nil) -> [[IO]] | nil (27149.0) -
IO.select と同じです。
...IO.select と同じです。
@param reads IO.select 参照
@param writes IO.select 参照
@param excepts IO.select 参照
@param timeout IO.select 参照
@see IO.select... -
IO
. select(reads , writes = [] , excepts = [] , timeout = nil) -> [[IO]] | nil (18143.0) -
select(2) を実行します。
...
select(2) を実行します。
与えられた入力/出力/例外待ちの IO オブジェクトの中から準備ができたものを
それぞれ配列にして、配列の配列として返します。
タイムアウトした時には nil を返します。
@param reads 入力待ちする......IO オブジェクトが閉じられていた時に発生します。
@raise Errno::EXXX select(2) に失敗した場合に発生します。
rp, wp = IO.pipe
mesg = "ping "
100.times{
rs, ws, = IO.select([rp], [wp])
if r = rs[0]
ret = r.read(5)
print ret
case ret
when....../ping/
mesg = "pong\n"
when /pong/
mesg = "ping "
end
end
if w = ws[0]
w.write(mesg)
end
}
@see Kernel.#select...