| 1 | |||||||||||
| 2 | package Apache2::ASP::Mock::Connection; | ||||||||||
| 3 | |||||||||||
| 4 | 23 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 23 | ▶ | use warnings 'all'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | 23 | ▶ | use Apache2::ASP::Mock::ClientSocket; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | |||||||||||
| 8 | |||||||||||
| 9 | #============================================================================== | ||||||||||
| 10 | sub new | ||||||||||
| 11 | { | ||||||||||
| 12 | 0 | ▶ | my ($class) = @_; | ||||||||
|
Subroutine
new: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 13 | |||||||||||
| 14 | 0 | my $s = bless { | |||||||||
| 15 | aborted => 0, | ||||||||||
| 16 | }, $class; | ||||||||||
| 17 | 0 | $s->{client_socket} = Apache2::ASP::Mock::ClientSocket->new( connection => $s ); | |||||||||
| 18 | |||||||||||
| 19 | 0 | return $s; | |||||||||
| 20 | }# end new() | ||||||||||
| 21 | |||||||||||
| 22 | |||||||||||
| 23 | #============================================================================== | ||||||||||
| 24 | sub aborted | ||||||||||
| 25 | { | ||||||||||
| 26 | 0 | ▶ | my ($s) = shift; | ||||||||
|
Subroutine
aborted: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 27 | 0 | ▶ | @_ ? $s->{aborted} = shift : $s->{aborted}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 28 | }# end aborted() | ||||||||||
| 29 | |||||||||||
| 30 | |||||||||||
| 31 | #============================================================================== | ||||||||||
| 32 | sub client_socket | ||||||||||
| 33 | { | ||||||||||
| 34 | 0 | ▶ | $_[0]->{client_socket}; | ||||||||
|
Subroutine
client_socket: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 35 | }# end client_socket() | ||||||||||
| 36 | |||||||||||
| 37 | |||||||||||
| 38 | #============================================================================== | ||||||||||
| 39 | sub DESTROY | ||||||||||
| 40 | { | ||||||||||
| 41 | 0 | ▶ | my $s = shift; | ||||||||
|
Subroutine
DESTROY: not called CC=1 SCAR=6.9
| |||||||||||
| 42 | 0 | undef(%$s); | |||||||||
| 43 | }# end DESTROY() | ||||||||||
| 44 | |||||||||||
| 45 | 23 | 1;# return true: | |||||||||
| 46 | |||||||||||
| 47 | |||||||||||
| 48 | =pod | ||||||||||
| 49 | |||||||||||
| 50 | =head1 NAME | ||||||||||
| 51 | |||||||||||
| 52 | Apache2::ASP::Mock::Connection - Mimics the Apache2::Connection object | ||||||||||
| 53 | |||||||||||
| 54 | =head1 SYNOPSIS | ||||||||||
| 55 | |||||||||||
| 56 | my $conn = $Response->context->connection; | ||||||||||
| 57 | unless( $conn->aborted ) | ||||||||||
| 58 | { | ||||||||||
| 59 | $conn->client_socket->close(); | ||||||||||
| 60 | }# end unless() | ||||||||||
| 61 | |||||||||||
| 62 | =head1 DESCRIPTION | ||||||||||
| 63 | |||||||||||
| 64 | This package mimics the L<Apache2::Connection> object in a normal mod_perl2 environment, | ||||||||||
| 65 | and is used by L<Apace2::ASP::API>. | ||||||||||
| 66 | |||||||||||
| 67 | =head1 PUBLIC PROPERTIES | ||||||||||
| 68 | |||||||||||
| 69 | =head2 aborted | ||||||||||
| 70 | |||||||||||
| 71 | Read-only. | ||||||||||
| 72 | |||||||||||
| 73 | Returns true or false, depending on whether the current connection is aborted. | ||||||||||
| 74 | |||||||||||
| 75 | =head2 client_socket | ||||||||||
| 76 | |||||||||||
| 77 | Returns the current L<Apache2::ASP::Mock::ClientSocket> object. | ||||||||||
| 78 | |||||||||||
| 79 | =head1 BUGS | ||||||||||
| 80 | |||||||||||
| 81 | It's possible that some bugs have found their way into this release. | ||||||||||
| 82 | |||||||||||
| 83 | Use RT L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=Apache2-ASP> to submit bug reports. | ||||||||||
| 84 | |||||||||||
| 85 | =head1 HOMEPAGE | ||||||||||
| 86 | |||||||||||
| 87 | Please visit the Apache2::ASP homepage at L<http://www.devstack.com/> to see examples | ||||||||||
| 88 | of Apache2::ASP in action. | ||||||||||
| 89 | |||||||||||
| 90 | =head1 AUTHOR | ||||||||||
| 91 | |||||||||||
| 92 | John Drago <jdrago_999@yahoo.com> | ||||||||||
| 93 | |||||||||||
| 94 | =head1 COPYRIGHT | ||||||||||
| 95 | |||||||||||
| 96 | Copyright 2008 John Drago. All rights reserved. | ||||||||||
| 97 | |||||||||||
| 98 | =head1 LICENSE | ||||||||||
| 99 | |||||||||||
| 100 | This software is Free software and is licensed under the same terms as perl itself. | ||||||||||
| 101 | |||||||||||
| 102 | =cut | ||||||||||
| 103 | |||||||||||
| 104 | |||||||||||