| 1 | |||
| 2 | package ASP4::Mock::ClientSocket; | ||
| 3 | |||
| 4 | 8 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | 8 | ▶ | use warnings 'all'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | |||
| 7 | sub new { | ||
| 8 | return bless { | ||
| 9 | ▶ | on_close => sub { }, | |
|
Subroutine
__ANON__: not called CC=1 SCAR=0.0
| |||
| 10 | 1 | ▶ | }, shift; |
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 11 | } | ||
| 12 | |||
| 13 | 1 | ▶ | sub on_close { my $s = shift; $s->{on_close} = shift } |
|
Subroutine
on_close: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 14 | 0 | ▶ | sub close { shift->{on_close}->( ) } |
|
Subroutine
close: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 15 | |||
| 16 | 8 | 1;# return true: | |
| 17 | |||
| 18 | =pod | ||
| 19 | |||
| 20 | =head1 NAME | ||
| 21 | |||
| 22 | ASP4::Mock::ClientSocket - Mimics APR::Socket object | ||
| 23 | |||
| 24 | =head1 SYNOPSIS | ||
| 25 | |||
| 26 | my $socket = $r->connection->client_socket | ||
| 27 | |||
| 28 | =head1 DESCRIPTION | ||
| 29 | |||
| 30 | Mimics (minimally) the L<APR::Socket> object. | ||
| 31 | |||
| 32 | =head1 PUBLIC METHODS | ||
| 33 | |||
| 34 | =head2 close( ) | ||
| 35 | |||
| 36 | Internal use only. | ||
| 37 | |||
| 38 | =cut | ||
| 39 | |||