about summary refs log tree commit homepage
path: root/lib/yahns/socket_helper.rb
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2018-12-08 17:33:51 +0000
committerEric Wong <e@80x24.org>2018-12-08 17:33:51 +0000
commit2ee9353fba7be5443db2ccdc3541586932ccf1f1 (patch)
treed3d39a754353c5078e468a219a289c2170d97614 /lib/yahns/socket_helper.rb
parentdbadf731d06a79cdae7afd23f4c20fb8fbb9c07e (diff)
downloadyahns-2ee9353fba7be5443db2ccdc3541586932ccf1f1.tar.gz
Since we've required Ruby 2.0+ for a while, we can assume
descriptors are created with IO#close_on_exec=true and
avoid bloating our code with calls to it.
Diffstat (limited to 'lib/yahns/socket_helper.rb')
-rw-r--r--lib/yahns/socket_helper.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/yahns/socket_helper.rb b/lib/yahns/socket_helper.rb
index 9d4afc0..963c9fa 100644
--- a/lib/yahns/socket_helper.rb
+++ b/lib/yahns/socket_helper.rb
@@ -19,7 +19,7 @@ module Yahns::SocketHelper # :nodoc:
 
   def set_server_sockopt(sock, opt)
     opt = {backlog: 1024}.merge!(opt)
-    sock.close_on_exec = true
+    sock.close_on_exec = true # needed for inherited sockets
 
     TCPSocket === sock and sock.setsockopt(:IPPROTO_TCP, :TCP_NODELAY, 1)
     sock.setsockopt(:SOL_SOCKET, :SO_KEEPALIVE, 1)