Protocol/Connection/UNIXSocket.pm

filter: Statementstmt 92.5% 25 / 27 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 7 / 7 Podpod 100% 1 / 1 totaltotal 91.8% 34 / 37 CC 2 SCAR 2.6
CC
2
Cov
90%
open
2.2
BEGIN
1.0
BEGIN
1.0
CRAP 1.3
« Protocol/Connection.pm ↑ Summary
1 #!/usr/bin/perl
2  
3 package X11::Protocol::Connection::UNIXSocket;
4  
5 # Copyright (C) 1997 Stephen McCamant. All rights reserved. This program
6 # is free software; you can redistribute and/or modify it under the same
7 # terms as Perl itself.
8  
9 1 ▶use X11::Protocol::Connection::Socket;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 1 ▶use IO::Socket;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 1 ▶use Socket;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 1 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
13 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
14 1 ▶use vars qw($VERSION @ISA);
Subroutine BEGIN: called CC=1 SCAR=0.0
15  
16 1 @ISA = ('X11::Protocol::Connection::Socket');
17  
18 1 $VERSION = 0.01;
19  
20 1 ▶sub open {
Subroutine open: called CC=2 SCAR=7.9
Pod documented
21 1 my($pkg) = shift;
22 1 my($host, $dispnum) = @_;
23 1 my($sock) = IO::Socket::UNIX->new('Type' => SOCK_STREAM(),
24 'Peer' => "/tmp/.X11-unix/X$dispnum");
25 1 ▶ croak "Can't connect to display `unix:$dispnum': $!" unless $sock;
Branch: 1 branch
BranchTrueFalseTotal
unless $sock 1 0 1
26 0 $sock->autoflush(0);
27 0 return bless \$sock, $pkg;
28 }
29 1 1;
30 __END__
« Protocol/Connection.pm ↑ Summary