11件ヒット
[1-11件を表示]
(0.026秒)
別のキーワード
検索結果
-
Socket
# connect _ nonblock(server _ sockaddr) -> 0 (18126.0) -
ソケットをノンブロッキングモードに設定した後、 connect(2) を呼び出します。
...PROGRESS エラーを報告した場合、その例外(Errno::EINPROGRESS)
には IO::WaitWritable が Object#extend されます。
これを connect_nonblock をリトライするために使うことができます。
# Pull down Google's web page
require 'socket'
include Socket::Constants......r_in(80, 'www.google.com')
begin # emulate blocking connect
socket.connect_nonblock(sockaddr)
rescue IO::WaitWritable
IO.select(nil, [socket]) # wait 3-way handshake completion
begin
socket.connect_nonblock(sockaddr) # check connection failure
rescue Errno::EISCONN
end...