Protocol/Connection/INETFH.pm untested

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