-# Copyright (C) 2015 all contributors <meta@public-inbox.org>
-# License: AGPLv3 or later (https://www.gnu.org/licenses/agpl-3.0.txt)
+# Copyright (C) 2015-2018 all contributors <meta@public-inbox.org>
+# License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
#
# Used by -nntpd for listen sockets
package PublicInbox::Listener;
use strict;
use warnings;
-use base 'Danga::Socket';
+use base 'PublicInbox::DS';
use Socket qw(SOL_SOCKET SO_KEEPALIVE IPPROTO_TCP TCP_NODELAY);
use fields qw(post_accept);
require IO::Handle;
listen($s, 1024);
IO::Handle::blocking($s, 0);
my $self = fields::new($class);
- $self->SUPER::new($s); # calls epoll_create for the first socket
- $self->watch_read(1);
+ $self->SUPER::new($s, PublicInbox::DS::EPOLLIN()|
+ PublicInbox::DS::EPOLLEXCLUSIVE());
$self->{post_accept} = $cb;
$self
}
-sub event_read {
+sub event_step {
my ($self) = @_;
my $sock = $self->{sock};