summaryrefslogtreecommitdiff
path: root/ext/socket/basicsocket.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/socket/basicsocket.c')
-rw-r--r--ext/socket/basicsocket.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/ext/socket/basicsocket.c b/ext/socket/basicsocket.c
index 5510c659f89..550c9500ba9 100644
--- a/ext/socket/basicsocket.c
+++ b/ext/socket/basicsocket.c
@@ -370,7 +370,13 @@ bsock_getpeername(VALUE sock)
*
* Socket.unix_server_loop("/tmp/sock") {|s|
* begin
- * p s.getpeereid #=> [1000, 1000]
+ * euid, egid = s.getpeereid
+ *
+ * # Check the connected client is myself or not.
+ * next if euid != Process.uid
+ *
+ * # do something about my resource.
+ *
* ensure
* s.close
* end