Protocol/Connection/INETSocket.pm untested

filter: Statementstmt 0.0% 0 / 27 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 7 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 37 CC 2 SCAR 11.0
CC
2
Cov
0%
open
6.0
BEGIN
2.0
BEGIN
2.0
CRAP 3.0
1 #!/usr/bin/perl
2  
3 package X11::Protocol::Connection::INETSocket;
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 use X11::Protocol::Connection::Socket;
10 use IO::Socket;
11 use Socket;
12 use Carp;
13 use strict;
14 use vars qw($VERSION @ISA);
15  
16 @ISA = ('X11::Protocol::Connection::Socket');
17  
18 $VERSION = 0.01;
19  
20 sub open {
21 my($pkg) = shift;
22 my($host, $dispnum) = @_;
23 my($sock) = IO::Socket::INET->new('PeerAddr' => $host,
24 'PeerPort' => 6000 + $dispnum,
25 'Type' => SOCK_STREAM(),
26 'Proto' => "tcp");
27 croak "Can't connect to display `$host:$dispnum': $!" unless $sock;
28 $sock->autoflush(1);
29 return bless \$sock, $pkg;
30 }
31 1;
32 __END__