=head1 NAME

IOMux::HTTP - HTTP protocol on IOMux

=head1 INHERITANCE

 IOMux::HTTP
   is a IOMux::Net::TCP
   is a IOMux::Handler::Read
   is a IOMux::Handler

   IOMux::Net::TCP also extends IOMux::Handler::Write
   is a IOMux::Handler::Write
   is a IOMux::Handler

 IOMux::HTTP is extended by
   IOMux::HTTP::Client
   IOMux::HTTP::Service

=head1 SYNOPSIS

  # base-class for IOMux::HTTP::Service or Client

=head1 METHODS

=head2 Constructors

=over 4

=item IOMux::HTTP-E<gt>B<new>(OPTIONS)

 -Option     --Defined in     --Default
  add_headers                   []
  fh           IOMux::Handler   <required>
  name         IOMux::Handler   'tcp $host:$port'
  read_size    IOMux::Handler::Read  32768
  socket       IOMux::Net::TCP  <required>
  write_size   IOMux::Handler::Write  4096

=over 2

=item add_headers => ARRAY

These headers will be added to each message sent. The parameter
is an ARRAY of field-name/field-content pairs.

=item fh => FILEHANDLE

=item name => STRING

=item read_size => INTEGER

=item socket => IO::Socket::INET

=item write_size => INTEGER

=back

=item IOMux::HTTP-E<gt>B<open>(MODE, WHAT, OPTIONS)
See L<IOMux::Handler/"Constructors">

=item IOMux::HTTP-E<gt>B<open>(MODE, WHAT, OPTIONS)
See L<IOMux::Handler/"Constructors">

=back

=head2 Accessors

=over 4

=item $obj-E<gt>B<fh>
See L<IOMux::Handler/"Accessors">

=item $obj-E<gt>B<fh>
See L<IOMux::Handler/"Accessors">

=item $obj-E<gt>B<fileno>
See L<IOMux::Handler/"Accessors">

=item $obj-E<gt>B<fileno>
See L<IOMux::Handler/"Accessors">

=item $obj-E<gt>B<mux>
See L<IOMux::Handler/"Accessors">

=item $obj-E<gt>B<mux>
See L<IOMux::Handler/"Accessors">

=item $obj-E<gt>B<name>
See L<IOMux::Handler/"Accessors">

=item $obj-E<gt>B<name>
See L<IOMux::Handler/"Accessors">

=item $obj-E<gt>B<readSize>([INTEGER])
See L<IOMux::Handler::Read/"Accessors">

=item $obj-E<gt>B<socket>
See L<IOMux::Net::TCP/"Accessors">

=item $obj-E<gt>B<startTime>

Returns a HASH with some basic information about the client, not
the socket itself.

=item $obj-E<gt>B<usesSSL>
See L<IOMux::Handler/"Accessors">

=item $obj-E<gt>B<usesSSL>
See L<IOMux::Handler/"Accessors">

=item $obj-E<gt>B<writeSize>([INTEGER])
See L<IOMux::Handler::Write/"Accessors">

=back

=head2 User interface

=head3 Connection

=over 4

=item $obj-E<gt>B<close>([CALLBACK])
See L<IOMux::Handler/"Connection">

=item $obj-E<gt>B<close>([CALLBACK])
See L<IOMux::Handler/"Connection">

=item $obj-E<gt>B<shutdown>((0|1|2))
See L<IOMux::Net::TCP/"Connection">

=item $obj-E<gt>B<timeout>([TIMEOUT])
See L<IOMux::Handler/"Connection">

=item $obj-E<gt>B<timeout>([TIMEOUT])
See L<IOMux::Handler/"Connection">

=back

=head3 Reading

=over 4

=item $obj-E<gt>B<readline>(CALLBACK)
See L<IOMux::Handler::Read/"Reading">

=item $obj-E<gt>B<slurp>(CALLBACK)
See L<IOMux::Handler::Read/"Reading">

=back

=head3 Writing

=over 4

=item $obj-E<gt>B<print>(STRING|SCALAR|LIST|ARRAY)
See L<IOMux::Handler::Write/"Writing">

=item $obj-E<gt>B<printf>(FORMAT, PARAMS)
See L<IOMux::Handler::Write/"Writing">

=item $obj-E<gt>B<say>(STRING|SCALAR|LIST|ARRAY)
See L<IOMux::Handler::Write/"Writing">

=item $obj-E<gt>B<write>(SCALAR, [MORE])
See L<IOMux::Handler::Write/"Writing">

=back

=head2 Multiplexer

=head3 Connection

=over 4

=item $obj-E<gt>B<mux_init>(MUX, [HANDLER])
See L<IOMux::Handler/"Connection">

=item $obj-E<gt>B<mux_init>(MUX, [HANDLER])
See L<IOMux::Handler/"Connection">

=item $obj-E<gt>B<mux_remove>
See L<IOMux::Handler/"Connection">

=item $obj-E<gt>B<mux_remove>
See L<IOMux::Handler/"Connection">

=item $obj-E<gt>B<mux_timeout>
See L<IOMux::Handler/"Connection">

=item $obj-E<gt>B<mux_timeout>
See L<IOMux::Handler/"Connection">

=back

=head3 Reading

=over 4

=item $obj-E<gt>B<mux_eof>
See L<IOMux::Net::TCP/"Multiplexer">

=item $obj-E<gt>B<mux_except_flagged>(FILENO)
See L<IOMux::Handler/"Reading">

=item $obj-E<gt>B<mux_except_flagged>(FILENO)
See L<IOMux::Handler/"Reading">

=item $obj-E<gt>B<mux_input>(BUFFER)
See L<IOMux::Handler::Read/"Reading">

=item $obj-E<gt>B<mux_read_flagged>(FILENO)
See L<IOMux::Handler/"Reading">

=item $obj-E<gt>B<mux_read_flagged>(FILENO)
See L<IOMux::Handler/"Reading">

=back

=head3 Writing

=over 4

=item $obj-E<gt>B<mux_outbuffer_empty>
See L<IOMux::Handler::Write/"Writing">

=item $obj-E<gt>B<mux_output_waiting>
See L<IOMux::Handler::Write/"Writing">

=item $obj-E<gt>B<mux_write_flagged>(FILENO)
See L<IOMux::Handler/"Writing">

=item $obj-E<gt>B<mux_write_flagged>(FILENO)
See L<IOMux::Handler/"Writing">

=back

=head3 Service

=head2 Helpers

=over 4

=item $obj-E<gt>B<extractSocket>(HASH)

=item IOMux::HTTP-E<gt>B<extractSocket>(HASH)
See L<IOMux::Handler/"Helpers">

=item $obj-E<gt>B<extractSocket>(HASH)

=item IOMux::HTTP-E<gt>B<extractSocket>(HASH)
See L<IOMux::Handler/"Helpers">

=item $obj-E<gt>B<fdset>(STATE, READ, WRITE, ERROR)
See L<IOMux::Handler/"Helpers">

=item $obj-E<gt>B<fdset>(STATE, READ, WRITE, ERROR)
See L<IOMux::Handler/"Helpers">

=item $obj-E<gt>B<show>
See L<IOMux::Handler/"Helpers">

=item $obj-E<gt>B<show>
See L<IOMux::Handler/"Helpers">

=back

=head2 HTTP protocol

=over 4

=item $obj-E<gt>B<closeConnection>

=item $obj-E<gt>B<sendMessage>(MESSAGE, CALLBACK)

Used by C<sendRequest()> (client) and C<sendResponse()> (server) to
send a MESSAGE. When the message has arrived, the CALLBACK will we
called.

=back

=head1 SEE ALSO

This module is part of IOMux-HTTP distribution version 0.11,
built on January 27, 2011. Website: F<http://perl.overmeer.net/>
All modules in this suite:
L</Any::Daemon>,
L</IOMux>, and
L</IOMux::HTTP>.

Please post questions or ideas to F<perl@overmeer.net>

=head1 LICENSE

Copyrights 2011 by Mark Overmeer. For other contributors see ChangeLog.

This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.
See F<http://www.perl.com/perl/misc/Artistic.html>

