summaryrefslogtreecommitdiff
path: root/ext/socket/lib/socket.rb
diff options
context:
space:
mode:
Diffstat (limited to 'ext/socket/lib/socket.rb')
-rw-r--r--ext/socket/lib/socket.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/socket/lib/socket.rb b/ext/socket/lib/socket.rb
index 34a4379..d5201ef 100644
--- a/ext/socket/lib/socket.rb
+++ b/ext/socket/lib/socket.rb
@@ -182,7 +182,7 @@ class Addrinfo
end
# creates a listening socket bound to self.
- def listen(backlog=5)
+ def listen(backlog=Socket::SOMAXCONN)
sock = Socket.new(self.pfamily, self.socktype, self.protocol)
begin
sock.ipv6only! if self.ipv6?
@@ -386,7 +386,7 @@ class Socket < BasicSocket
ai_list = Addrinfo.getaddrinfo(host, 0, nil, :STREAM, nil, Socket::AI_PASSIVE)
sockets = ip_sockets_port0(ai_list, true)
sockets.each {|s|
- s.listen(5)
+ s.listen(Socket::SOMAXCONN)
}
sockets
ensure