るりまサーチ (Ruby 2.1.0)

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

別のキーワード

  1. openssl new
  2. _builtin new
  3. rexml/document new
  4. resolv new
  5. socket new

ライブラリ

クラス

検索結果

BasicSocket#remote_address -> Addrinfo (87376.0)

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

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

返されたオブジェクトの Addrinfo#protocol は 0 を
返すことに注意してください。

require 'socket'

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

TCPServer.open("127.0.0.1", 1728) {|serv|
c = TCP...