| line | stmt | bran | cond | sub | pod | time | code | 
| 1 |  |  |  |  |  |  | #  You may distribute under the terms of either the GNU General Public License | 
| 2 |  |  |  |  |  |  | #  or the Artistic License (the same terms as Perl itself) | 
| 3 |  |  |  |  |  |  | # | 
| 4 |  |  |  |  |  |  | #  (C) Paul Evans, 2010-2020 -- leonerd@leonerd.org.uk | 
| 5 |  |  |  |  |  |  |  | 
| 6 |  |  |  |  |  |  | package Net::Async::Tangence::ServerProtocol 0.16; | 
| 7 |  |  |  |  |  |  |  | 
| 8 | 6 |  |  | 6 |  | 1187 | use v5.14; | 
|  | 6 |  |  |  |  | 22 |  | 
| 9 | 6 |  |  | 6 |  | 33 | use warnings; | 
|  | 6 |  |  |  |  | 24 |  | 
|  | 6 |  |  |  |  | 221 |  | 
| 10 |  |  |  |  |  |  |  | 
| 11 | 6 |  |  | 6 |  | 34 | use base qw( Net::Async::Tangence::Protocol Tangence::Server ); | 
|  | 6 |  |  |  |  | 11 |  | 
|  | 6 |  |  |  |  | 2941 |  | 
| 12 | 6 |  |  | 6 |  | 32106 | use mro 'c3'; | 
|  | 6 |  |  |  |  | 17 |  | 
|  | 6 |  |  |  |  | 56 |  | 
| 13 |  |  |  |  |  |  |  | 
| 14 | 6 |  |  | 6 |  | 201 | use Carp; | 
|  | 6 |  |  |  |  | 15 |  | 
|  | 6 |  |  |  |  | 1852 |  | 
| 15 |  |  |  |  |  |  |  | 
| 16 |  |  |  |  |  |  | =head1 NAME | 
| 17 |  |  |  |  |  |  |  | 
| 18 |  |  |  |  |  |  | C - C | 
| 19 |  |  |  |  |  |  | subclass for servers | 
| 20 |  |  |  |  |  |  |  | 
| 21 |  |  |  |  |  |  | =head1 DESCRIPTION | 
| 22 |  |  |  |  |  |  |  | 
| 23 |  |  |  |  |  |  | This subclass of L provides additional logic | 
| 24 |  |  |  |  |  |  | required by the server side of a connection. It is not intended to be directly | 
| 25 |  |  |  |  |  |  | used by server implementations. | 
| 26 |  |  |  |  |  |  |  | 
| 27 |  |  |  |  |  |  | =cut | 
| 28 |  |  |  |  |  |  |  | 
| 29 |  |  |  |  |  |  | sub _init | 
| 30 |  |  |  |  |  |  | { | 
| 31 | 6 |  |  | 6 |  | 241 | my $self = shift; | 
| 32 | 6 |  |  |  |  | 18 | my ( $params ) = @_; | 
| 33 |  |  |  |  |  |  |  | 
| 34 | 6 |  |  |  |  | 73 | $self->registry( delete $params->{registry} ); | 
| 35 |  |  |  |  |  |  |  | 
| 36 | 6 |  | 50 |  |  | 104 | $params->{on_closed} ||= undef; | 
| 37 |  |  |  |  |  |  |  | 
| 38 | 6 |  |  |  |  | 39 | $self->SUPER::_init( $params ); | 
| 39 |  |  |  |  |  |  | } | 
| 40 |  |  |  |  |  |  |  | 
| 41 |  |  |  |  |  |  | sub configure | 
| 42 |  |  |  |  |  |  | { | 
| 43 | 12 |  |  | 12 | 1 | 772 | my $self = shift; | 
| 44 | 12 |  |  |  |  | 36 | my %params = @_; | 
| 45 |  |  |  |  |  |  |  | 
| 46 | 12 | 100 |  |  |  | 50 | if( exists $params{on_closed} ) { | 
| 47 | 6 |  |  |  |  | 37 | my $on_closed = $params{on_closed}; | 
| 48 |  |  |  |  |  |  | $params{on_closed} = sub { | 
| 49 | 2 |  |  | 2 |  | 7 | my $self = shift; | 
| 50 |  |  |  |  |  |  |  | 
| 51 | 2 | 50 |  |  |  | 14 | $on_closed->( $self ) if $on_closed; | 
| 52 | 6 |  |  |  |  | 43 | }; | 
| 53 |  |  |  |  |  |  | } | 
| 54 |  |  |  |  |  |  |  | 
| 55 | 12 |  |  |  |  | 70 | $self->SUPER::configure( %params ); | 
| 56 |  |  |  |  |  |  | } | 
| 57 |  |  |  |  |  |  |  | 
| 58 |  |  |  |  |  |  | sub rootobj | 
| 59 |  |  |  |  |  |  | { | 
| 60 | 6 |  |  | 6 | 1 | 1055 | my $self = shift; | 
| 61 | 6 |  |  |  |  | 20 | my ( $identity ) = @_; | 
| 62 |  |  |  |  |  |  |  | 
| 63 | 6 |  |  |  |  | 34 | return $self->parent->conn_rootobj( $self, $identity ); | 
| 64 |  |  |  |  |  |  | } | 
| 65 |  |  |  |  |  |  |  | 
| 66 |  |  |  |  |  |  | sub permit_registry | 
| 67 |  |  |  |  |  |  | { | 
| 68 | 6 |  |  | 6 | 1 | 1587 | my $self = shift; | 
| 69 | 6 |  |  |  |  | 41 | return $self->parent->conn_permits_registry( $self ); | 
| 70 |  |  |  |  |  |  | } | 
| 71 |  |  |  |  |  |  |  | 
| 72 |  |  |  |  |  |  | =head1 AUTHOR | 
| 73 |  |  |  |  |  |  |  | 
| 74 |  |  |  |  |  |  | Paul Evans | 
| 75 |  |  |  |  |  |  |  | 
| 76 |  |  |  |  |  |  | =cut | 
| 77 |  |  |  |  |  |  |  | 
| 78 |  |  |  |  |  |  | 0x55AA; |