Branch Coverage

blib/lib/POE/Wheel/SocketFactory.pm
Criterion Covered Total %
branch 118 256 46.0


line true false branch
56 0 23 if ($@)
64 0 23 if ($@)
66 0 0 if ($@)
73 0 23 if ($@)
78 0 23 if ($@)
153 0 4 if ($^O eq 'os2')
155 0 0 unless ($address =~ m[^/socket/])
176 0 22 unless defined $domain
193 64 0 if ($peer) { }
0 0 elsif ($! != 11 and $! != 103 and $! != 29) { }
195 2 62 if ($domain eq 'unix') { }
62 0 elsif ($domain eq 'inet') { }
0 0 elsif ($domain eq 'inet6') { }
198 0 2 if length $@
217 0 0 if $$event_failure
245 0 77 unless defined $domain
277 3 74 if ($!)
278 3 0 if defined $$event_failure
287 0 74 if ($!)
288 0 0 if defined $$event_failure
299 2 72 if ($domain eq 'unix') { }
72 0 elsif ($domain eq 'inet') { }
0 0 elsif ($domain eq 'inet6') { }
300 2 0 if (defined $peer)
302 0 2 if length $@
308 72 0 if (defined $peer)
312 0 72 if (length $@)
320 0 0 if (defined $peer)
322 0 0 if ($error)
344 0 77 if ($^O eq 'cygwin' or $^O eq 'MSWin32')
365 0 0 if ($!)
366 0 0 if defined $$event_failure
390 0 101 if scalar @_ & 1
395 101 101 if ($name eq 'SuccessEvent') { }
101 0 elsif ($name eq 'FailureEvent') { }
396 101 0 if (defined $event) { }
397 0 101 if (ref $event)
408 101 0 if (defined $event) { }
409 0 101 if (ref $event)
425 22 79 if (defined $$self[5]) { }
79 0 elsif (defined $$self[6]) { }
436 0 79 if ($^O eq 'cygwin' or $^O eq 'MSWin32')
453 0 24 unless defined $$self[0] and fileno $$self[0]
469 0 103 if @_ & 1
474 0 103 if @_ and ref $_[0] eq 'POE::Kernel'
478 0 103 unless defined $POE::Wheel::SocketFactory::poe_kernel
479 0 103 unless defined $params{'SuccessEvent'}
480 0 103 unless defined $params{'FailureEvent'}
507 24 79 if (defined $domain) { }
519 0 103 unless (defined $abstract_domain)
540 4 99 if ($abstract_domain eq 'unix') { }
99 0 elsif ($abstract_domain eq 'inet' or $abstract_domain eq 'inet6') { }
541 0 4 if defined $params{'SocketProtocol'}
553 5 94 defined $params{'SocketProtocol'} ? :
560 99 0 unless ($socket_protocol =~ /^\d+$/)
561 0 99 unless ($socket_protocol = $proto_by_name{$socket_protocol} || eval { do { getprotobyname $socket_protocol } })
573 0 99 unless ($protocol_name)
580 0 99 unless (defined $supported_protocol{$abstract_domain}{$protocol_name})
591 0 103 if (defined $params{'SocketType'}) { }
595 0 103 unless (defined $default_socket_type{$abstract_domain}{$protocol_name})
607 0 103 if (POE::Kernel::RUNNING_IN_HELL())
616 0 0 if $@
621 0 0 unless socket POE, 2, 1, 6
630 0 0 if $@
634 0 103 unless (socket $socket_handle, $$self[4], $$self[10], $$self[9])
651 0 103 if (POE::Kernel::RUNNING_IN_HELL())
653 0 0 unless socket POE, 2, 1, 6
659 0 0 if $@
676 0 0 if (defined $params{'Reuse'} and lc $params{'Reuse'} eq 'yes' || lc $params{'Reuse'} eq 'on' || $params{'Reuse'} =~ /\d+/ && $params{'Reuse'})
686 0 24 unless (setsockopt $socket_handle, 1, 2, 1)
704 99 4 if ($abstract_domain eq 'inet') { }
0 4 elsif ($abstract_domain eq 'inet6') { }
4 0 elsif ($abstract_domain eq 'unix') { }
706 24 75 if (defined $params{'BindAddress'} or defined $params{'BindPort'})
709 24 0 defined $params{'BindAddress'} ? :
716 23 0 if eval { do { require bytes } }
719 24 0 unless (length $bind_address == 4)
723 0 24 unless (defined $bind_address)
734 24 0 defined $params{'BindPort'} ? :
735 0 24 if ($bind_port =~ /[^0-9]/)
737 0 0 unless (defined $bind_port)
748 0 24 unless (defined $bind_address)
764 0 0 if (defined $params{'BindAddress'} or defined $params{'BindPort'})
767 0 0 defined $params{'BindAddress'} ? :
775 0 0 defined $params{'BindPort'} ? :
776 0 0 if ($bind_port =~ /[^0-9]/)
778 0 0 unless (defined $bind_port)
789 23 0 if eval { do { require bytes } }
799 0 0 unless (@addresses)
800 0 0 if $error
817 0 4 if defined $params{'BindPort'}
819 2 2 if (defined $params{'BindAddress'})
821 0 2 if (defined $params{'RemotePort'})
832 0 2 unless ($bind_address)
849 26 77 if (defined $bind_address)
850 0 26 unless (bind $socket_handle, $bind_address)
867 77 26 if (defined $params{'RemoteAddress'}) { }
872 75 2 if ($abstract_domain eq 'inet' or $abstract_domain eq 'inet6') { }
2 0 elsif ($abstract_domain eq 'unix') { }
877 0 75 unless defined $params{'RemotePort'}
878 0 75 if defined $params{'ListenQueue'}
881 0 75 if ($remote_port =~ /[^0-9]/)
882 0 0 unless ($remote_port = getservbyname($remote_port, $protocol_name))
893 75 0 if ($abstract_domain eq 'inet') { }
0 0 elsif ($abstract_domain eq 'inet6') { }
905 0 0 if (not @addresses) { }
906 0 0 if $error
925 0 75 unless (defined $connect_address)
934 75 0 if ($abstract_domain eq 'inet') { }
0 0 elsif ($abstract_domain eq 'inet6') { }
945 0 75 unless ($connect_address)
962 0 2 unless (defined $connect_address)
979 0 26 if defined $params{'RemotePort'}
986 77 26 if (defined $connect_address)
987 75 2 unless (connect $socket_handle, $connect_address)
988 0 75 if ($! and $! != 115 and $! != 11)
1015 26 0 if (exists $supported_protocol{$abstract_domain}{$protocol_name}) { }
1020 22 4 if ($protocol_op eq 'listens') { }
1029 0 22 unless (listen $socket_handle, $listen_queue)
1048 0 4 if defined $params{'ListenQueue'}
1050 4 0 if ($protocol_op eq 'nothing') { }
1074 24 0 if (defined $$self[0] and defined $$self[5] and defined $$self[12])
1085 22 0 if (defined $$self[0] and defined $$self[5] and defined $$self[12])
1123 99 81 if (defined $$socket_selected)
1128 22 158 if (defined $$state_accept)
1133 77 103 if (defined $$state_connect)
1138 0 180 if (defined $$mine_success)
1143 0 180 if (defined $$mine_failure)