about summary refs log tree commit homepage
path: root/lib/yahns/socket_helper.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/yahns/socket_helper.rb')
-rw-r--r--lib/yahns/socket_helper.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/yahns/socket_helper.rb b/lib/yahns/socket_helper.rb
index 61f2b0f..62a6da2 100644
--- a/lib/yahns/socket_helper.rb
+++ b/lib/yahns/socket_helper.rb
@@ -5,6 +5,7 @@
 module Yahns::SocketHelper # :nodoc:
   def set_server_sockopt(sock, opt)
     opt = {backlog: 1024}.merge!(opt) if opt
+    sock.close_on_exec = true
 
     TCPSocket === sock and sock.setsockopt(:IPPROTO_TCP, :TCP_NODELAY, 1)
     sock.setsockopt(:SOL_SOCKET, :SO_KEEPALIVE, 1)