るりまサーチ (Ruby 2.1.0)

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

別のキーワード

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

ライブラリ

キーワード

検索結果

BasicSocket#do_not_reverse_lookup -> bool (18343.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.ruby-lang.org", 80) {|sock|
p sock.do_not_reverse_lookup # => true
}

@see BasicSocket#do_not_reverse_lookup=...

BasicSocket#local_address -> Addrinfo (18343.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...