die $@ if $@;
%o = (LocalAddr => $l, ReuseAddr => 1, Proto => 'tcp');
}
- $o{Listen} = 1024;
+ $o{Listen} = 2**31 - 1; # kernel will clamp
my $prev = umask 0000;
my $s = eval { $sock_pkg->new(%o) } or
warn "error binding $l: $! ($@)\n";
use v5.12;
use parent qw(PublicInbox::DS PublicInbox::LeiExternal
PublicInbox::LeiQuery);
-use autodie qw(bind chdir open pipe socket socketpair syswrite unlink);
+use autodie qw(bind chdir listen open pipe socket socketpair syswrite unlink);
use Getopt::Long ();
use Socket qw(AF_UNIX SOCK_SEQPACKET pack_sockaddr_un);
use Errno qw(EPIPE EAGAIN ECONNREFUSED ENOENT ECONNRESET EINTR);
local (%PATH2CFG, $MDIR2CFGPATH);
local $daemon_pid = $$;
$listener->blocking(0);
+ listen $listener, 2**31 - 1; # kernel will clamp
my $exit_code;
my $pil = PublicInbox::Listener->new($listener, \&accept_dispatch);
local $quit = do {
my ($class, $s, $cb, $multi_accept) = @_;
setsockopt($s, SOL_SOCKET, SO_KEEPALIVE, 1);
setsockopt($s, IPPROTO_TCP, TCP_NODELAY, 1); # ignore errors on non-TCP
- listen($s, 2**31 - 1); # kernel will clamp
my $self = bless { post_accept => $cb }, $class;
$self->{multi_accept} = $multi_accept //= $MULTI_ACCEPT;
$self->SUPER::new($s, EPOLLIN|EPOLLEXCLUSIVE);