1Protocol::Connection(3)User Contributed Perl DocumentatioPnrotocol::Connection(3)
2
3
4

NAME

6       X11::Protocol::Connection - Perl module abstract base class for X11
7       client to server connections
8

SYNOPSIS

10         # In connection object module
11         package X11::Protocol::Connection::CarrierPigeon;
12         use X11::Protocol::Connection;
13         @ISA = ('X11::Protocol::Connection');
14         sub open { ... }
15         sub give { ... }
16         sub get { ... }
17         sub fh { ... }
18         ...
19
20         # In program
21         $connection = X11::Protocol::Connection::CarrierPigeon
22           ->open($host, $display_number);
23         $x = X11::Protocol->new($connection);
24
25         $connection->give($data);
26
27         $reply = unpack("I", $connection->get(4));
28
29         use IO::Select;
30         $sel = IO::select->new($connection->fh);
31         if ($sel->can_read == $connection->fh) ...
32

DESCRIPTION

34       This module is an abstract base class for the various X11::Proto‐
35       col::Connection::* modules that provide connections to X servers for
36       the X11::Protocol module. It provides stubs for the following methods:
37
38       open
39
40         $conn = X11::Protocol::Connection::Foo->open($host, $display_num)
41
42       Open a connection to the specified display (numbered from 0) on the
43       specified $host.
44
45       give
46
47         $conn->give($data)
48
49       Send the given data to the server. Normally, this method is used only
50       by the protocol module itself.
51
52       get
53
54         $data = $conn->get($n)
55
56       Read $n bytes of data from the server. Normally, this method is used
57       only by the protocol module itself.
58
59       fh
60
61         $filehandle = $conn->fh
62
63       Return an object suitable for use as a filehandle. This is mainly use‐
64       ful for doing select() and other such system calls.
65

AUTHOR

67       Stephen McCamant <SMCCAM@cpan.org>.
68

SEE ALSO

70       perl(1), X11::Protocol, X11::Protocol::Connection::Socket, X11::Proto‐
71       col::Connection::FileHandle, X11::Protocol::Connection::INETSocket,
72       X11::Protocol::Connection::UNIXSocket, X11::Protocol::Connec‐
73       tion::INETFH, X11::Protocol::Connection::UNIXFH.
74
75
76
77perl v5.8.8                       2006-09-16           Protocol::Connection(3)
Impressum