るりまサーチ (Ruby 2.1.0)

最速Rubyリファレンスマニュアル検索!
1件ヒット [1-1件を表示] (0.049秒)
トップページ > クエリ:-[x] > クエリ:next[x] > バージョン:2.1.0[x] > クエリ:getpeereid[x] > ライブラリ:socket[x]

別のキーワード

  1. _builtin -
  2. open-uri open
  3. irb/input-method gets
  4. irb/input-method new
  5. matrix -

クラス

検索結果

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

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

..., 2番目の要素が egid です。

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

require 'socket'

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

# Check the connected client is myself or not....