| 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
| |||||||||||
| 26 | 0 | $sock->autoflush(0); | |||||||||
| 27 | 0 | return bless \$sock, $pkg; | |||||||||
| 28 | } | ||||||||||
| 29 | 1 | 1; | |||||||||
| 30 | __END__ | ||||||||||