various fixes and enhancements
[AnyEvent-HTTPD.git] / lib / BS / HTTPD / HTTPServer.pm
blobb253c47ce65977b2652d55974af5e707e1f25793
1 package BS::HTTPD::HTTPServer;
2 use feature ':5.10';
3 use strict;
4 no warnings;
6 use BS::HTTPD::TCPListener;
7 use BS::HTTPD::HTTPConnection;
9 =head1 NAME
11 BS::HTTPD::HTTPServer - A simple and plain http server
13 =head1 DESCRIPTION
15 This class handles incoming TCP connections for HTTP clients.
16 It's used by L<BS::HTTPD> to do it's job.
18 It has no public interface yet.
20 =head1 COPYRIGHT & LICENSE
22 Copyright 2008 Robin Redeker, all rights reserved.
24 This program is free software; you can redistribute it and/or modify it
25 under the same terms as Perl itself.
27 =cut
29 our @ISA = qw/BS::HTTPD::TCPListener/;
31 sub new {
32 my $this = shift;
33 my $class = ref($this) || $this;
34 my $self = $class->SUPER::new (@_);
36 $self->reg_cb (
37 connect => sub {
38 my ($list, $cl) = @_;
40 disconnect => sub {
41 my ($list, $cl) = @_;
45 return $self
48 sub connection_class { 'BS::HTTPD::HTTPConnection' }