ASP/Mock/ClientSocket.pm

filter: Statementstmt 62.5% 10 / 16 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 60.0% 3 / 5 Podpod 50.0% 1 / 2 totaltotal 60.8% 14 / 23 CC 1 SCAR 3.4
CC
1
Cov
62%
new
2.0
close
2.0
BEGIN
1.0
CRAP 1.4
« ASP/Mock/Pool.pm ↑ Summary ASP/ConfigLoader.pm »
1  
2 package Apache2::ASP::Mock::ClientSocket;
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 Scalar::Util 'weaken';
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8  
9 #==============================================================================
10 sub new
11 {
12 0 ▶ my ($class, %args) = @_;
Subroutine new: not called CC=1 SCAR=6.9
Pod undocumented
13
14 0 my $s = bless \%args, $class;
15
16 0 weaken($s->{connection});
17 0 return $s;
18 }# end new()
19  
20  
21 #==============================================================================
22 sub close
23 {
24 0 ▶ my $s = shift;
Subroutine close: not called CC=1 SCAR=6.9
Pod documented
25
26 0 $s->{connection}->aborted( 1 );
27 }# end close()
28  
29 23 1;# return true:
30  
31 =pod
32  
33 =head1 NAME
34  
35 Apache2::ASP::Mock::ClientSocket - Mimics the APR::Socket object
36  
37 =head1 SYNOPSIS
38  
39 my $socket = $Response->context->connection->client_socket;
40 $socket->close();
41  
42 =head1 DESCRIPTION
43  
44 This package mimics the L<APR::Socket> object in a normal mod_perl2 environment,
45 and is used by L<Apace2::ASP::API>.
46  
47 =head1 PUBLIC METHODS
48  
49 =head2 close( )
50  
51 Pretends to close the current connection.
52
53 =head1 BUGS
54
55 It's possible that some bugs have found their way into this release.
56
57 Use RT L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=Apache2-ASP> to submit bug reports.
58
59 =head1 HOMEPAGE
60
61 Please visit the Apache2::ASP homepage at L<http://www.devstack.com/> to see examples
62 of Apache2::ASP in action.
63  
64 =head1 AUTHOR
65  
66 John Drago <jdrago_999@yahoo.com>
67  
68 =head1 COPYRIGHT
69  
70 Copyright 2008 John Drago. All rights reserved.
71  
72 =head1 LICENSE
73  
74 This software is Free software and is licensed under the same terms as perl itself.
75  
76 =cut
77  
78  
« ASP/Mock/Pool.pm ↑ Summary ASP/ConfigLoader.pm »