るりまサーチ (Ruby 2.3.0)

最速Rubyリファレンスマニュアル検索!
2件ヒット [1-2件を表示] (0.079秒)

別のキーワード

  1. kernel $-l
  2. matrix l
  3. _builtin $-l
  4. lupdecomposition l
  5. l matrix

クラス

キーワード

検索結果

BasicSocket#do_not_reverse_lookup -> bool (27346.0)

ソケットごとのアドレスからホスト名への逆引きの設定を返します。

...きの
BasicSocket.do_not_reverse_lookup の値になります。

require 'socket'

BasicSocket.do_not_reverse_lookup = false
TCPSocket.open("www.ruby-lang.org", 80) {|sock|
p sock.do_not_reverse_lookup # => false
}
BasicSocket.do_not_reverse_lookup = true
TCPSocket.open("www.r...
...uby-lang.org", 80) {|sock|
p sock.do_not_reverse_lookup # => true
}

@see BasicSocket#do_not_reverse_lookup=...

BasicSocket#local_address -> Addrinfo (27346.0)

getsockname(2) で得られたローカルアドレス情報を Addrinfo オブジェクトとして返します。

...してください。

require 'socket'

TCPSocket.open("www.ruby-lang.org", 80) {|s|
p s.local_address #=> #<Addrinfo: 192.168.0.129:36873 TCP>
}

TCPServer.open("127.0.0.1", 1512) {|serv|
p serv.local_address #=> #<Addrinfo: 127.0.0.1:1512 TCP>
}

@see BasicSocket#getsockname...