るりまサーチ

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

別のキーワード

  1. _builtin errno
  2. exxx errno
  3. systemcallerror errno
  4. new errno::exxx
  5. send errno::exxx

ライブラリ

クラス

検索結果

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

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

...connect と同じです。

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

# Pull down Google's web page
r...
...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
socket.write("GET /...
...HTTP/1.0\r\n\r\n")
results = socket.read



@param server_sockaddr 接続先アドレス
@raise Errno::EXXX connect(2) がエラーを報告した場合に発生します。詳しくは
man を参照してください。...