るりまサーチ

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

別のキーワード

  1. net/imap content_id
  2. openssl id
  3. json create_id
  4. json create_id=
  5. drb install_id_conv

ライブラリ

検索結果

BasicSocket#getpeereid -> [Integer, Integer] (6101.0)

Unix ドメインソケットにおいて接続相手の euid と egid を 返します。

...の euid と egid
返します。

配列の最初の要素が euid, 2番目の要素が egid です。

ソケットが Unix ドメインソケットでない場合の返り値は
不定です。

require 'socket'

Socket.unix_server_loop("/tmp/sock") {|s|
begin
euid, egid = s.get...
...peereid

# Check the connected client is myself or not.
next if euid != Process.uid

# do something about my resource.
ensure
s.close
end
}...