るりまサーチ

最速Rubyリファレンスマニュアル検索!
11件ヒット [1-11件を表示] (0.030秒)
トップページ > クエリ:nil[x] > クエリ:check[x] > クエリ:connect_nonblock[x]

別のキーワード

  1. socket so_no_check
  2. mkmf check_signedness
  3. mkmf check_sizeof
  4. kernel check_signedness
  5. kernel check_sizeof

ライブラリ

クラス

検索結果

Socket#connect_nonblock(server_sockaddr) -> 0 (18131.0)

ソケットをノンブロッキングモードに設定した後、 connect(2) を呼び出します。

...PROGRESS エラーを報告した場合、その例外(Errno::EINPROGRESS)
には IO::WaitWritable が Object#extend されます。
これを connect_nonblock をリトライするために使うことができます。

# Pull down Google's web page
require 'socket'
include Socket::Constants...
...'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
end
s...