]> Sergey Matveev's repositories - public-inbox.git/blob - lib/PublicInbox/DS.pm
treewide: "require" + "use" cleanup and docs
[public-inbox.git] / lib / PublicInbox / DS.pm
1 # This library is free software; you can redistribute it and/or modify
2 # it under the same terms as Perl itself.
3 #
4 # This license differs from the rest of public-inbox
5 #
6 # This is a fork of the (for now) unmaintained Danga::Socket 1.61.
7 # Unused features will be removed, and updates will be made to take
8 # advantage of newer kernels.
9 #
10 # API changes to diverge from Danga::Socket will happen to better
11 # accomodate new features and improve scalability.  Do not expect
12 # this to be a stable API like Danga::Socket.
13 # Bugs encountered (and likely fixed) are reported to
14 # bug-Danga-Socket@rt.cpan.org and visible at:
15 # https://rt.cpan.org/Public/Dist/Display.html?Name=Danga-Socket
16 package PublicInbox::DS;
17 use strict;
18 use bytes;
19 use POSIX qw(WNOHANG);
20 use IO::Handle qw();
21 use Fcntl qw(SEEK_SET :DEFAULT);
22 use Time::HiRes qw(clock_gettime CLOCK_MONOTONIC);
23 use parent qw(Exporter);
24 our @EXPORT_OK = qw(now msg_more);
25 use warnings;
26 use 5.010_001;
27 use Scalar::Util qw(blessed);
28
29 use PublicInbox::Syscall qw(:epoll);
30 use PublicInbox::Tmpfile;
31
32 use fields ('sock',              # underlying socket
33             'rbuf',              # scalarref, usually undef
34             'wbuf',              # arrayref of coderefs or GLOB refs
35             'wbuf_off',  # offset into first element of wbuf to start writing at
36             );
37
38 use Errno qw(EAGAIN EINVAL);
39 use Carp qw(confess carp);
40
41 my $nextq; # queue for next_tick
42 my $WaitPids; # list of [ pid, callback, callback_arg ]
43 my $later_queue; # callbacks
44 my $EXPMAP; # fd -> [ idle_time, $self ]
45 our $EXPTIME = 180; # 3 minutes
46 my ($later_timer, $reap_timer, $exp_timer);
47 our (
48      %DescriptorMap,             # fd (num) -> PublicInbox::DS object
49      $Epoll,                     # Global epoll fd (or DSKQXS ref)
50      $_io,                       # IO::Handle for Epoll
51      @ToClose,                   # sockets to close when event loop is done
52
53      $PostLoopCallback,          # subref to call at the end of each loop, if defined (global)
54
55      $LoopTimeout,               # timeout of event loop in milliseconds
56      $DoneInit,                  # if we've done the one-time module init yet
57      @Timers,                    # timers
58      $in_loop,
59      );
60
61 Reset();
62
63 #####################################################################
64 ### C L A S S   M E T H O D S
65 #####################################################################
66
67 =head2 C<< CLASS->Reset() >>
68
69 Reset all state
70
71 =cut
72 sub Reset {
73     %DescriptorMap = ();
74     $nextq = [];
75     $WaitPids = [];
76     $later_queue = [];
77     $EXPMAP = {};
78     $reap_timer = $later_timer = $exp_timer = undef;
79     @ToClose = ();
80     $LoopTimeout = -1;  # no timeout by default
81     @Timers = ();
82
83     $PostLoopCallback = undef;
84     $DoneInit = 0;
85
86     $_io = undef; # closes real $Epoll FD
87     $Epoll = undef; # may call DSKQXS::DESTROY
88
89     *EventLoop = *FirstTimeEventLoop;
90 }
91
92 =head2 C<< CLASS->SetLoopTimeout( $timeout ) >>
93
94 Set the loop timeout for the event loop to some value in milliseconds.
95
96 A timeout of 0 (zero) means poll forever. A timeout of -1 means poll and return
97 immediately.
98
99 =cut
100 sub SetLoopTimeout {
101     return $LoopTimeout = $_[1] + 0;
102 }
103
104 =head2 C<< CLASS->AddTimer( $seconds, $coderef ) >>
105
106 Add a timer to occur $seconds from now. $seconds may be fractional, but timers
107 are not guaranteed to fire at the exact time you ask for.
108
109 Returns a timer object which you can call C<< $timer->cancel >> on if you need to.
110
111 =cut
112 sub AddTimer {
113     my ($class, $secs, $coderef) = @_;
114
115     my $fire_time = now() + $secs;
116
117     my $timer = bless [$fire_time, $coderef], "PublicInbox::DS::Timer";
118
119     if (!@Timers || $fire_time >= $Timers[-1][0]) {
120         push @Timers, $timer;
121         return $timer;
122     }
123
124     # Now, where do we insert?  (NOTE: this appears slow, algorithm-wise,
125     # but it was compared against calendar queues, heaps, naive push/sort,
126     # and a bunch of other versions, and found to be fastest with a large
127     # variety of datasets.)
128     for (my $i = 0; $i < @Timers; $i++) {
129         if ($Timers[$i][0] > $fire_time) {
130             splice(@Timers, $i, 0, $timer);
131             return $timer;
132         }
133     }
134
135     die "Shouldn't get here.";
136 }
137
138 # keeping this around in case we support other FD types for now,
139 # epoll_create1(EPOLL_CLOEXEC) requires Linux 2.6.27+...
140 sub set_cloexec ($) {
141     my ($fd) = @_;
142
143     $_io = IO::Handle->new_from_fd($fd, 'r+') or return;
144     defined(my $fl = fcntl($_io, F_GETFD, 0)) or return;
145     fcntl($_io, F_SETFD, $fl | FD_CLOEXEC);
146 }
147
148 sub _InitPoller
149 {
150     return if $DoneInit;
151     $DoneInit = 1;
152
153     if (PublicInbox::Syscall::epoll_defined())  {
154         $Epoll = epoll_create();
155         set_cloexec($Epoll) if (defined($Epoll) && $Epoll >= 0);
156     } else {
157         my $cls;
158         for (qw(DSKQXS DSPoll)) {
159             $cls = "PublicInbox::$_";
160             last if eval "require $cls";
161         }
162         $cls->import(qw(epoll_ctl epoll_wait));
163         $Epoll = $cls->new;
164     }
165     *EventLoop = *EpollEventLoop;
166 }
167
168 =head2 C<< CLASS->EventLoop() >>
169
170 Start processing IO events. In most daemon programs this never exits. See
171 C<PostLoopCallback> below for how to exit the loop.
172
173 =cut
174 sub FirstTimeEventLoop {
175     my $class = shift;
176
177     _InitPoller();
178
179     EventLoop($class);
180 }
181
182 sub now () { clock_gettime(CLOCK_MONOTONIC) }
183
184 sub next_tick () {
185     my $q = $nextq;
186     $nextq = [];
187     for (@$q) {
188         # we avoid "ref" on blessed refs to workaround a Perl 5.16.3 leak:
189         # https://rt.perl.org/Public/Bug/Display.html?id=114340
190         if (blessed($_)) {
191             $_->event_step;
192         } else {
193             $_->();
194         }
195     }
196 }
197
198 # runs timers and returns milliseconds for next one, or next event loop
199 sub RunTimers {
200     next_tick();
201
202     return ((@$nextq || @ToClose) ? 0 : $LoopTimeout) unless @Timers;
203
204     my $now = now();
205
206     # Run expired timers
207     while (@Timers && $Timers[0][0] <= $now) {
208         my $to_run = shift(@Timers);
209         $to_run->[1]->($now) if $to_run->[1];
210     }
211
212     # timers may enqueue into nextq:
213     return 0 if (@$nextq || @ToClose);
214
215     return $LoopTimeout unless @Timers;
216
217     # convert time to an even number of milliseconds, adding 1
218     # extra, otherwise floating point fun can occur and we'll
219     # call RunTimers like 20-30 times, each returning a timeout
220     # of 0.0000212 seconds
221     my $timeout = int(($Timers[0][0] - $now) * 1000) + 1;
222
223     # -1 is an infinite timeout, so prefer a real timeout
224     return $timeout     if $LoopTimeout == -1;
225
226     # otherwise pick the lower of our regular timeout and time until
227     # the next timer
228     return $LoopTimeout if $LoopTimeout < $timeout;
229     return $timeout;
230 }
231
232 # We can't use waitpid(-1) safely here since it can hit ``, system(),
233 # and other things.  So we scan the $WaitPids list, which is hopefully
234 # not too big.
235 sub reap_pids {
236     my $tmp = $WaitPids;
237     $WaitPids = [];
238     $reap_timer = undef;
239     foreach my $ary (@$tmp) {
240         my ($pid, $cb, $arg) = @$ary;
241         my $ret = waitpid($pid, WNOHANG);
242         if ($ret == 0) {
243             push @$WaitPids, $ary;
244         } elsif ($cb) {
245             eval { $cb->($arg, $pid) };
246         }
247     }
248     if (@$WaitPids) {
249         # we may not be donea, and we may miss our
250         $reap_timer = AddTimer(undef, 1, \&reap_pids);
251     }
252 }
253
254 # reentrant SIGCHLD handler (since reap_pids is not reentrant)
255 sub enqueue_reap ($) { push @$nextq, \&reap_pids };
256
257 sub EpollEventLoop {
258     local $in_loop = 1;
259     do {
260         my @events;
261         my $i;
262         my $timeout = RunTimers();
263
264         # get up to 1000 events
265         my $evcount = epoll_wait($Epoll, 1000, $timeout, \@events);
266         for ($i=0; $i<$evcount; $i++) {
267             # it's possible epoll_wait returned many events, including some at the end
268             # that ones in the front triggered unregister-interest actions.  if we
269             # can't find the %sock entry, it's because we're no longer interested
270             # in that event.
271             $DescriptorMap{$events[$i]->[0]}->event_step;
272         }
273     } while (PostEventLoop());
274     _run_later();
275 }
276
277 =head2 C<< CLASS->SetPostLoopCallback( CODEREF ) >>
278
279 Sets post loop callback function.  Pass a subref and it will be
280 called every time the event loop finishes.
281
282 Return 1 (or any true value) from the sub to make the loop continue, 0 or false
283 and it will exit.
284
285 The callback function will be passed two parameters: \%DescriptorMap
286
287 =cut
288 sub SetPostLoopCallback {
289     my ($class, $ref) = @_;
290
291     # global callback
292     $PostLoopCallback = (defined $ref && ref $ref eq 'CODE') ? $ref : undef;
293 }
294
295 # Internal function: run the post-event callback, send read events
296 # for pushed-back data, and close pending connections.  returns 1
297 # if event loop should continue, or 0 to shut it all down.
298 sub PostEventLoop {
299     # now we can close sockets that wanted to close during our event processing.
300     # (we didn't want to close them during the loop, as we didn't want fd numbers
301     #  being reused and confused during the event loop)
302     delete($DescriptorMap{fileno($_)}) for @ToClose;
303     @ToClose = (); # let refcounting drop everything all at once
304
305     # by default we keep running, unless a postloop callback (either per-object
306     # or global) cancels it
307     my $keep_running = 1;
308
309     # now we're at the very end, call callback if defined
310     if (defined $PostLoopCallback) {
311         $keep_running &&= $PostLoopCallback->(\%DescriptorMap);
312     }
313
314     return $keep_running;
315 }
316
317 #####################################################################
318 ### PublicInbox::DS-the-object code
319 #####################################################################
320
321 =head2 OBJECT METHODS
322
323 =head2 C<< CLASS->new( $socket ) >>
324
325 Create a new PublicInbox::DS subclass object for the given I<socket> which will
326 react to events on it during the C<EventLoop>.
327
328 This is normally (always?) called from your subclass via:
329
330   $class->SUPER::new($socket);
331
332 =cut
333 sub new {
334     my ($self, $sock, $ev) = @_;
335     $self = fields::new($self) unless ref $self;
336
337     $self->{sock} = $sock;
338     my $fd = fileno($sock);
339
340     Carp::cluck("undef sock and/or fd in PublicInbox::DS->new.  sock=" . ($sock || "") . ", fd=" . ($fd || ""))
341         unless $sock && $fd;
342
343     _InitPoller();
344
345     if (epoll_ctl($Epoll, EPOLL_CTL_ADD, $fd, $ev)) {
346         if ($! == EINVAL && ($ev & EPOLLEXCLUSIVE)) {
347             $ev &= ~EPOLLEXCLUSIVE;
348             goto retry;
349         }
350         die "couldn't add epoll watch for $fd: $!\n";
351     }
352     Carp::cluck("PublicInbox::DS::new blowing away existing descriptor map for fd=$fd ($DescriptorMap{$fd})")
353         if $DescriptorMap{$fd};
354
355     $DescriptorMap{$fd} = $self;
356     return $self;
357 }
358
359
360 #####################################################################
361 ### I N S T A N C E   M E T H O D S
362 #####################################################################
363
364 sub requeue ($) { push @$nextq, $_[0] }
365
366 =head2 C<< $obj->close >>
367
368 Close the socket.
369
370 =cut
371 sub close {
372     my ($self) = @_;
373     my $sock = delete $self->{sock} or return;
374
375     # we need to flush our write buffer, as there may
376     # be self-referential closures (sub { $client->close })
377     # preventing the object from being destroyed
378     delete $self->{wbuf};
379
380     # if we're using epoll, we have to remove this from our epoll fd so we stop getting
381     # notifications about it
382     my $fd = fileno($sock);
383     epoll_ctl($Epoll, EPOLL_CTL_DEL, $fd, 0) and
384         confess("EPOLL_CTL_DEL: $!");
385
386     # we explicitly don't delete from DescriptorMap here until we
387     # actually close the socket, as we might be in the middle of
388     # processing an epoll_wait/etc that returned hundreds of fds, one
389     # of which is not yet processed and is what we're closing.  if we
390     # keep it in DescriptorMap, then the event harnesses can just
391     # looked at $pob->{sock} == undef and ignore it.  but if it's an
392     # un-accounted for fd, then it (understandably) freak out a bit
393     # and emit warnings, thinking their state got off.
394
395     # defer closing the actual socket until the event loop is done
396     # processing this round of events.  (otherwise we might reuse fds)
397     push @ToClose, $sock;
398
399     return 0;
400 }
401
402 # portable, non-thread-safe sendfile emulation (no pread, yet)
403 sub psendfile ($$$) {
404     my ($sock, $fh, $off) = @_;
405
406     seek($fh, $$off, SEEK_SET) or return;
407     defined(my $to_write = read($fh, my $buf, 16384)) or return;
408     my $written = 0;
409     while ($to_write > 0) {
410         if (defined(my $w = syswrite($sock, $buf, $to_write, $written))) {
411             $written += $w;
412             $to_write -= $w;
413         } else {
414             return if $written == 0;
415             last;
416         }
417     }
418     $$off += $written;
419     $written;
420 }
421
422 sub epbit ($$) { # (sock, default)
423     ref($_[0]) eq 'IO::Socket::SSL' ? PublicInbox::TLS::epollbit() : $_[1];
424 }
425
426 # returns 1 if done, 0 if incomplete
427 sub flush_write ($) {
428     my ($self) = @_;
429     my $wbuf = $self->{wbuf} or return 1;
430     my $sock = $self->{sock};
431
432 next_buf:
433     while (my $bref = $wbuf->[0]) {
434         if (ref($bref) ne 'CODE') {
435             my $off = delete($self->{wbuf_off}) // 0;
436             while ($sock) {
437                 my $w = psendfile($sock, $bref, \$off);
438                 if (defined $w) {
439                     if ($w == 0) {
440                         shift @$wbuf;
441                         goto next_buf;
442                     }
443                 } elsif ($! == EAGAIN) {
444                     epwait($sock, epbit($sock, EPOLLOUT) | EPOLLONESHOT);
445                     $self->{wbuf_off} = $off;
446                     return 0;
447                 } else {
448                     return $self->close;
449                 }
450             }
451         } else { #($ref eq 'CODE') {
452             shift @$wbuf;
453             my $before = scalar(@$wbuf);
454             $bref->($self);
455
456             # bref may be enqueueing more CODE to call (see accept_tls_step)
457             return 0 if (scalar(@$wbuf) > $before);
458         }
459     } # while @$wbuf
460
461     delete $self->{wbuf};
462     1; # all done
463 }
464
465 sub rbuf_idle ($$) {
466     my ($self, $rbuf) = @_;
467     if ($$rbuf eq '') { # who knows how long till we can read again
468         delete $self->{rbuf};
469     } else {
470         $self->{rbuf} = $rbuf;
471     }
472 }
473
474 sub do_read ($$$;$) {
475     my ($self, $rbuf, $len, $off) = @_;
476     my $r = sysread(my $sock = $self->{sock}, $$rbuf, $len, $off // 0);
477     return ($r == 0 ? $self->close : $r) if defined $r;
478     # common for clients to break connections without warning,
479     # would be too noisy to log here:
480     if ($! == EAGAIN) {
481         epwait($sock, epbit($sock, EPOLLIN) | EPOLLONESHOT);
482         rbuf_idle($self, $rbuf);
483         0;
484     } else {
485         $self->close;
486     }
487 }
488
489 # drop the socket if we hit unrecoverable errors on our system which
490 # require BOFH attention: ENOSPC, EFBIG, EIO, EMFILE, ENFILE...
491 sub drop {
492     my $self = shift;
493     carp(@_);
494     $self->close;
495 }
496
497 # n.b.: use ->write/->read for this buffer to allow compatibility with
498 # PerlIO::mmap or PerlIO::scalar if needed
499 sub tmpio ($$$) {
500     my ($self, $bref, $off) = @_;
501     my $fh = tmpfile('wbuf', $self->{sock}, 1) or
502         return drop($self, "tmpfile $!");
503     $fh->autoflush(1);
504     my $len = bytes::length($$bref) - $off;
505     $fh->write($$bref, $len, $off) or return drop($self, "write ($len): $!");
506     $fh
507 }
508
509 =head2 C<< $obj->write( $data ) >>
510
511 Write the specified data to the underlying handle.  I<data> may be scalar,
512 scalar ref, code ref (to run when there).
513 Returns 1 if writes all went through, or 0 if there are writes in queue. If
514 it returns 1, caller should stop waiting for 'writable' events)
515
516 =cut
517 sub write {
518     my ($self, $data) = @_;
519
520     # nobody should be writing to closed sockets, but caller code can
521     # do two writes within an event, have the first fail and
522     # disconnect the other side (whose destructor then closes the
523     # calling object, but it's still in a method), and then the
524     # now-dead object does its second write.  that is this case.  we
525     # just lie and say it worked.  it'll be dead soon and won't be
526     # hurt by this lie.
527     my $sock = $self->{sock} or return 1;
528     my $ref = ref $data;
529     my $bref = $ref ? $data : \$data;
530     my $wbuf = $self->{wbuf};
531     if ($wbuf && scalar(@$wbuf)) { # already buffering, can't write more...
532         if ($ref eq 'CODE') {
533             push @$wbuf, $bref;
534         } else {
535             my $last = $wbuf->[-1];
536             if (ref($last) eq 'GLOB') { # append to tmp file buffer
537                 $last->print($$bref) or return drop($self, "print: $!");
538             } else {
539                 my $tmpio = tmpio($self, $bref, 0) or return 0;
540                 push @$wbuf, $tmpio;
541             }
542         }
543         return 0;
544     } elsif ($ref eq 'CODE') {
545         $bref->($self);
546         return 1;
547     } else {
548         my $to_write = bytes::length($$bref);
549         my $written = syswrite($sock, $$bref, $to_write);
550
551         if (defined $written) {
552             return 1 if $written == $to_write;
553             requeue($self); # runs: event_step -> flush_write
554         } elsif ($! == EAGAIN) {
555             epwait($sock, epbit($sock, EPOLLOUT) | EPOLLONESHOT);
556             $written = 0;
557         } else {
558             return $self->close;
559         }
560
561         # deal with EAGAIN or partial write:
562         my $tmpio = tmpio($self, $bref, $written) or return 0;
563
564         # wbuf may be an empty array if we're being called inside
565         # ->flush_write via CODE bref:
566         push @{$self->{wbuf} ||= []}, $tmpio;
567         return 0;
568     }
569 }
570
571 use constant MSG_MORE => ($^O eq 'linux') ? 0x8000 : 0;
572
573 sub msg_more ($$) {
574     my $self = $_[0];
575     my $sock = $self->{sock} or return 1;
576     my $wbuf = $self->{wbuf};
577
578     if (MSG_MORE && (!defined($wbuf) || !scalar(@$wbuf)) &&
579                 ref($sock) ne 'IO::Socket::SSL') {
580         my $n = send($sock, $_[1], MSG_MORE);
581         if (defined $n) {
582             my $nlen = bytes::length($_[1]) - $n;
583             return 1 if $nlen == 0; # all done!
584             # queue up the unwritten substring:
585             my $tmpio = tmpio($self, \($_[1]), $n) or return 0;
586             $self->{wbuf} //= $wbuf //= [];
587             push @$wbuf, $tmpio;
588             epwait($sock, EPOLLOUT|EPOLLONESHOT);
589             return 0;
590         }
591     }
592
593     # don't redispatch into NNTPdeflate::write
594     PublicInbox::DS::write($self, \($_[1]));
595 }
596
597 sub epwait ($$) {
598     my ($sock, $ev) = @_;
599     epoll_ctl($Epoll, EPOLL_CTL_MOD, fileno($sock), $ev) and
600         confess("EPOLL_CTL_MOD $!");
601 }
602
603 # return true if complete, false if incomplete (or failure)
604 sub accept_tls_step ($) {
605     my ($self) = @_;
606     my $sock = $self->{sock} or return;
607     return 1 if $sock->accept_SSL;
608     return $self->close if $! != EAGAIN;
609     epwait($sock, PublicInbox::TLS::epollbit() | EPOLLONESHOT);
610     unshift @{$self->{wbuf} ||= []}, \&accept_tls_step;
611     0;
612 }
613
614 # return true if complete, false if incomplete (or failure)
615 sub shutdn_tls_step ($) {
616     my ($self) = @_;
617     my $sock = $self->{sock} or return;
618     return $self->close if $sock->stop_SSL(SSL_fast_shutdown => 1);
619     return $self->close if $! != EAGAIN;
620     epwait($sock, PublicInbox::TLS::epollbit() | EPOLLONESHOT);
621     unshift @{$self->{wbuf} ||= []}, \&shutdn_tls_step;
622     0;
623 }
624
625 # don't bother with shutdown($sock, 2), we don't fork+exec w/o CLOEXEC
626 # or fork w/o exec, so no inadvertant socket sharing
627 sub shutdn ($) {
628     my ($self) = @_;
629     my $sock = $self->{sock} or return;
630     if (ref($sock) eq 'IO::Socket::SSL') {
631         shutdn_tls_step($self);
632     } else {
633         $self->close;
634     }
635 }
636
637 # must be called with eval, PublicInbox::DS may not be loaded (see t/qspawn.t)
638 sub dwaitpid ($$$) {
639     my ($pid, $cb, $arg) = @_;
640     if ($in_loop) {
641         push @$WaitPids, [ $pid, $cb, $arg ];
642
643         # We could've just missed our SIGCHLD, cover it, here:
644         requeue(\&reap_pids);
645     } else {
646         die "Not in EventLoop\n";
647     }
648 }
649
650 sub _run_later () {
651     my $run = $later_queue;
652     $later_timer = undef;
653     $later_queue = [];
654     $_->() for @$run;
655 }
656
657 sub later ($) {
658     my ($cb) = @_;
659     push @$later_queue, $cb;
660     $later_timer //= AddTimer(undef, 60, \&_run_later);
661 }
662
663 sub expire_old () {
664     my $now = now();
665     my $exp = $EXPTIME;
666     my $old = $now - $exp;
667     my %new;
668     while (my ($fd, $v) = each %$EXPMAP) {
669         my ($idle_time, $ds_obj) = @$v;
670         if ($idle_time < $old) {
671             if (!$ds_obj->shutdn) {
672                 $new{$fd} = $v;
673             }
674         } else {
675             $new{$fd} = $v;
676         }
677     }
678     $EXPMAP = \%new;
679     $exp_timer = scalar(keys %new) ? later(\&expire_old) : undef;
680 }
681
682 sub update_idle_time {
683     my ($self) = @_;
684     my $sock = $self->{sock} or return;
685     $EXPMAP->{fileno($sock)} = [ now(), $self ];
686     $exp_timer //= later(\&expire_old);
687 }
688
689 sub not_idle_long {
690     my ($self, $now) = @_;
691     my $sock = $self->{sock} or return;
692     my $ary = $EXPMAP->{fileno($sock)} or return;
693     my $exp_at = $ary->[0] + $EXPTIME;
694     $exp_at > $now;
695 }
696
697 package PublicInbox::DS::Timer;
698 # [$abs_float_firetime, $coderef];
699 sub cancel {
700     $_[0][1] = undef;
701 }
702
703 1;
704
705 =head1 AUTHORS (Danga::Socket)
706
707 Brad Fitzpatrick <brad@danga.com> - author
708
709 Michael Granger <ged@danga.com> - docs, testing
710
711 Mark Smith <junior@danga.com> - contributor, heavy user, testing
712
713 Matt Sergeant <matt@sergeant.org> - kqueue support, docs, timers, other bits