File Coverage

blib/lib/Hoppy/TCPHandler/Connected.pm
Criterion Covered Total %
statement 16 17 94.1
branch 1 2 50.0
condition n/a
subroutine 4 4 100.0
pod 1 1 100.0
total 22 24 91.6


line stmt bran cond sub pod time code
1             package Hoppy::TCPHandler::Connected;
2 7     7   39 use strict;
  7         12  
  7         280  
3 7     7   34 use warnings;
  7         12  
  7         213  
4 7     7   42 use base qw( Hoppy::Base );
  7         15  
  7         1265  
5              
6             sub do_handle {
7 1     1 1 16 my $self = shift;
8 1         3 my $poe = shift;
9 1         12 my $c = $self->context;
10 1         24 my $session_id = $poe->session->ID;
11              
12 1         23 $c->{sessions}->{$session_id} = 1;
13 1         7 $c->{not_authorized}->{$session_id} = 1;
14              
15 1 50       5 if ( my $hook = $c->hook->{client_connect} ) {
16 0           $hook->work( { poe => $poe } );
17             }
18             }
19              
20             1;
21             __END__