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
35       X11::Protocol::Connection::* modules that provide connections to X
36       servers for the X11::Protocol module. It provides stubs for the
37       following methods:
38
39   open
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         $conn->give($data)
47
48       Send the given data to the server. Normally, this method is used only
49       by the protocol module itself.
50
51   get
52         $data = $conn->get($n)
53
54       Read $n bytes of data from the server. Normally, this method is used
55       only by the protocol module itself.
56
57   fh
58         $filehandle = $conn->fh
59
60       Return an object suitable for use as a filehandle. This is mainly
61       useful for doing select() and other such system calls.
62

AUTHOR

64       Stephen McCamant <SMCCAM@cpan.org>.
65

SEE ALSO

67       perl(1), X11::Protocol, X11::Protocol::Connection::Socket,
68       X11::Protocol::Connection::FileHandle,
69       X11::Protocol::Connection::INETSocket,
70       X11::Protocol::Connection::UNIXSocket,
71       X11::Protocol::Connection::INETFH, X11::Protocol::Connection::UNIXFH.
72
73
74
75perl v5.36.0                      2022-07-22           Protocol::Connection(3)
Impressum