Branch Coverage

blib/lib/Net/Socket/NonBlock.pm
Criterion Covered Total %
branch 43 164 26.2


line true false branch
135 0 4 unless &{$SockAvail;}($SRec)
138 4 0 $$SRec{'BuffSize'} < 32767 ? :
0 0 unless $BufLen and $BufLen > 0 and $BufLen < 32767 and $BufLen < $$SRec{'BuffSize'}
145 4 0 if ($$SRec{'Input'}[0])
147 0 2 if ($$SRec{'Input'}[0]{'Data'} =~ s/\A(.{0,$BufLen}\n)//m or $$SRec{'Input'}[0]{'Data'} =~ s/\A(.{$BufLen}.)//m or $$SRec{'EOF'} and $$SRec{'Input'}[0]{'Data'} =~ s/\A([.\n]+)//m)
156 0 0 unless ($$SRec{'TCP'} or length $$SRec{'Input'}[0]{'Data'})
163 0 4 wantarray ? :
170 0 0 unless &{$SockAvail;}($SRec)
173 0 0 $$SRec{'BuffSize'} < 32767 ? :
0 0 unless $BufLen and $BufLen > 0 and $BufLen < 32767 and $BufLen < $$SRec{'BuffSize'}
180 0 0 if ($$SRec{'Input'}[0])
182 0 0 if ($$SRec{'Input'}[0]{'Data'} =~ s/\A(.{0,$BufLen}\n)//m or $$SRec{'Input'}[0]{'Data'} =~ s/\A(.{0,$BufLen}.)//m)
190 0 0 unless ($$SRec{'TCP'} or length $$SRec{'Input'}[0]{'Data'})
197 0 0 wantarray ? :
204 0 0 unless &{$SockAvail;}($SRec)
207 0 0 unless $BufLen and $BufLen > 0 and $BufLen < $$SRec{'BuffSize'}
212 0 0 if ($$SRec{'Input'}[0])
220 0 0 unless ($$SRec{'TCP'} or length $$SRec{'Input'}[0]{'Data'})
227 0 0 wantarray ? :
234 0 2 unless &{$SockAvail;}($SRec)
237 2 0 if ($$SRec{'TCP'}) { }
239 0 2 unless defined $$SRec{'Output'}[0]{'Data'}
241 0 2 ref $Data eq 'ARRAY' ? :
246 0 0 unless defined $PeerAddr
248 0 0 unless defined $PeerPort
253 0 0 unless defined $PeerIP and defined $Dest
256 0 0 ref $Data eq 'ARRAY' ? :
268 0 0 unless &{$SockAvail;}($SRec)
277 0 0 unless &{$SockAvail;}($SRec)
287 0 0 unless &{$SockAvail;}($SRec)
297 0 1 unless &{$SockAvail;}($SRec)
307 0 0 unless &{$SockAvail;}($SRec)
317 0 0 unless &{$SockAvail;}($SRec)
331 0 0 if defined $$SRec{$Key}
338 0 0 $$SRec{'Socket'}->sockopt(6) ? :
342 0 0 if defined $Params{$Key} and defined $$SRec{$Key}
346 0 0 $Params{'Broadcast'} ? :
0 0 if defined $Params{'Broadcast'}
349 0 0 wantarray ? :
358 0 3 if $Flush and $Timeout
382 0 1 unless $$Nest{'Select'} = 'IO::Select'->new
385 0 1 defined $Params{'SelectT'} ? :
386 1 0 defined $Params{'SilenceT'} ? :
387 0 1 defined $Params{'BuffSize'} ? :
388 0 1 defined $Params{'MaxClients'} ? :
389 1 0 defined $Params{'debug'} ? :
399 0 2 if (not scalar @_ & 1 and $_[1] =~ /\ANet\:\:Socket\:\:NonBlock\=HASH\(\w+\)\Z/iso)
405 0 0 unless $SRec = $$Nest{'Pool'}{$SRec}
407 0 0 wantarray ? :
417 8 0 defined $$Nest{$Key} ? :
423 0 8 if defined $Params{$Key}
427 0 2 wantarray ? :
431 0 2 wantarray ? :
696 6 0 if $ErrArray
714 0 3 if ($$SRec{'EOF'} or $$SRec{'Close'} or &{$BuffSize;}($SRec, 'Input') >= $$SRec{'BuffSize'})
718 1 2 if ($$SRec{'Accept'} and $$SRec{'TCP'})
723 0 1 unless &{$Accept;}($Nest, $SRec) and &{$ThrowMsg;}(undef, $$Nest{'debug'}, "${SRec}: incoming connection accepted")
729 2 0 $$SRec{'TCP'} ? :
0 2 unless my($Res) = &{$$SRec{'TCP'} ? $RecvTCP : $RecvUDP;}($Nest, $SRec, $CurTime)
750 0 14 unless defined $OutRec and not $$SRec{'EOF'}
755 12 2 if (not $DataLen and $$SRec{'TCP'})
762 0 2 unless (defined $Res)
768 0 2 unless ($Res == $DataLen or $! == 11)
770 0 0 if ($$SRec{'TCP'})
789 2 0 if ($$SRec{'TCP'}) { }
810 0 0 if $SelectT
818 0 0 if $SilenceT
826 0 1 if ($Params{'Proto'} =~ /\A\s*tcp\s*\Z/io and ref $Params{'Accept'} ne 'CODE')
833 0 1 unless my $newSRec = &{$AddSock;}($Nest, 'IO::Socket::INET'->new(%Params), \%Params)
843 0 1 unless my $newSRec = &{$AddSock;}($Nest, 'IO::Socket::INET'->new(%Params), \%Params)
856 0 4 unless $$Nest{'Pool'}{$SRec}
865 0 0 unless $$Nest{'Pool'}{$SRec}
874 0 0 unless $$Nest{'Pool'}{$SRec}
883 0 2 unless $$Nest{'Pool'}{$SRec}
892 0 0 unless $$Nest{'Pool'}{$SRec}
901 0 0 unless $$Nest{'Pool'}{$SRec}
910 0 0 unless $$Nest{'Pool'}{$SRec}
919 0 0 unless $$Nest{'Pool'}{$SRec}
928 0 1 unless $$Nest{'Pool'}{$SRec}
937 0 0 unless $$Nest{'Pool'}{$SRec}
946 0 3 unless $$Nest{'Pool'}{$SRec}
957 0 1 if $$Nest{'debug'}