るりまサーチ (Ruby 2.1.0)

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

別のキーワード

  1. webrick/https client_cert
  2. openssl client_ca
  3. openssl client_ca=
  4. imap client_thread
  5. imap client_thread=

クラス

キーワード

検索結果

UNIXServer#accept -> UnixSocket (46.0)

クライアントからの接続要求を accept(2)で待ち受け、接続した UNIXSocket のインスタンスを返します。

...ライアントからの接続要求を accept(2)で待ち受け、接続した
UNIXSocket のインスタンスを返します。

例:

require 'socket'

UNIXServer.open("/tmp/s") {|serv|
c = UNIXSocket.open("/tmp/s")
s = serv.accept
s.write "from server"
c.write "from client"...

BasicSocket#getpeereid -> [Integer, Integer] (28.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....