This file is indexed.

/usr/share/doc/lprng-doc/LPRng-Reference-Multipart/socketapi.htm is in lprng-doc 3.8.A~rc2-3.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
  <meta name="generator" content=
  "HTML Tidy for Linux/x86 (vers 6 November 2007), see www.w3.org">

  <title>Socket API</title>
  <meta name="GENERATOR" content=
  "Modular DocBook HTML Stylesheet Version 1.79">
  <link rel="HOME" title=" LPRng Reference Manual" href=
  "index.htm">
  <link rel="UP" title="Printer Communication and Protocols " href=
  "printercomm.htm">
  <link rel="PREVIOUS" title="RFC1179 (LPD) Connection" href=
  "x4879.htm">
  <link rel="NEXT" title="AppSocket TCP/IP Protocol " href=
  "appsocket.htm">
</head>

<body class="SECT1" bgcolor="#FFFFFF" text="#000000" link="#0000FF"
vlink="#840084" alink="#0000FF">
  <div class="NAVHEADER">
    <table summary="Header navigation table" width="100%" border=
    "0" cellpadding="0" cellspacing="0">
      <tr>
        <th colspan="3" align="center">LPRng Reference Manual: 24
        Sep 2004 (For LPRng-3.8.28)</th>
      </tr>

      <tr>
        <td width="10%" align="left" valign="bottom"><a href=
        "x4879.htm" accesskey="P">Prev</a></td>

        <td width="80%" align="center" valign="bottom">Chapter 11.
        Printer Communication and Protocols</td>

        <td width="10%" align="right" valign="bottom"><a href=
        "appsocket.htm" accesskey="N">Next</a></td>
      </tr>
    </table>
    <hr align="left" width="100%">
  </div>

  <div class="SECT1">
    <h1 class="SECT1"><a name="SOCKETAPI" id="SOCKETAPI">11.3.
    Socket API</a></h1>

    <p>The Socket API is a very flexible job transfer protocol. It
    is widely support by most Print Server manufacturers, with the
    Hewlett Packard JetDirect setting the <span class=
    "emphasis"><i class="EMPHASIS">de facto</i></span> standard.
    The Socket API is extremely simple.</p>

    <ol type="1">
      <li>
        <p>The user establishes a connection to TCP/IP port on the
        Printer or Network Print spooler. The HP JetDirect uses
        port 9100 by default, but other ports are used as well.
        This connection may be refused if the printer is busy
        printing a job.</p>
      </li>

      <li>
        <p>When the network connection is established to a system
        which has an <span class="emphasis"><i class=
        "EMPHASIS">internal printer</i></span> or for which the
        Network Print Spooler is an integral part of the system,
        the printer usually flushes all internal buffers and
        readies itself to receive a new job. However, when you are
        using an external Print Server box, you may need to send
        specific initialization sequences to the printer to ensure
        that it is reset correctly and is ready to receive new
        jobs.</p>
      </li>

      <li>
        <p>When the connection is made, all bytes sent to the
        connection are either transferred to and external interface
        to directly to a <span class="emphasis"><i class=
        "EMPHASIS">print buffer</i></span> used by the printer's
        Print Engine.</p>
      </li>

      <li>
        <p>The connection is bidirectional, and information sent to
        the external port by an external printer or error messages
        and status generated by the printer's Print Engine will be
        transferred over the data link to the user.</p>
      </li>

      <li>
        <p>The Network Print spooler will keep the connection open
        until it is closed by the user. During this period it may
        continue to report status or other information such as
        printer On Line, paper outages, and so forth.</p>
      </li>

      <li>
        <p>If the connection to the printer is <span class=
        "emphasis"><i class="EMPHASIS">half-closed</i></span>, that
        is, the <code class="FUNCTION">shutdown()</code> network
        system call is used to indicate to the remote printer that
        no further data will be sent, then the printer may
        immediately terminate the network connection. This means
        that no further network or status messages will be sent to
        the user.</p>
      </li>

      <li>
        <p>If the connection is to a External Print Server, then
        usually the connection can be immediately re-established.
        It is the responsibility of the user to ensure that a the
        printer has finished its work before sending a new job.</p>
      </li>

      <li>
        <p>If the connection is to an internal Print Server, then
        usually the printer will not allow the connection to be
        made, or will refuse all data transfers on the connection
        until the printer finishes with the previous job and all
        internal buffers have been cleared.</p>
      </li>
    </ol>

    <p>The following is a sample printcap showing how to use the
    Socket API:</p>

    <div class="INFORMALEXAMPLE">
      <a name="AEN4935" id="AEN4935"></a>
      <pre class="SCREEN">
lp:
  # make a socket connection to port 9100
  :lp=10.0.0.2%9100
</pre>
    </div>

    <p>You can use the <a href="http://www.l0pht.com/~weld/netcat/"
    target="_top">netcat</a> utility by Hobbit <code class=
    "EMAIL">&lt;<a href=
    "mailto:Hobbit@avian.org">Hobbit@avian.org</a>&gt;</code> to
    test that the Socket interface is available and working. If
    <tt class="FILENAME">ellipse.ps</tt> is a test file, then: The
    simplest and easiest way to print a file to a network printer
    appears</p>

    <div class="INFORMALEXAMPLE">
      <a name="AEN4941" id="AEN4941"></a>
      <pre class="SCREEN">
  nc printer.ip.addr 9100 &lt; file
Example:
  nc 10.0.0.25 9100 &lt; ellipse.ps
</pre>
    </div>
  </div>

  <div class="NAVFOOTER">
    <hr align="left" width="100%">

    <table summary="Footer navigation table" width="100%" border=
    "0" cellpadding="0" cellspacing="0">
      <tr>
        <td width="33%" align="left" valign="top"><a href=
        "x4879.htm" accesskey="P">Prev</a></td>

        <td width="34%" align="center" valign="top"><a href=
        "index.htm" accesskey="H">Home</a></td>

        <td width="33%" align="right" valign="top"><a href=
        "appsocket.htm" accesskey="N">Next</a></td>
      </tr>

      <tr>
        <td width="33%" align="left" valign="top">RFC1179 (LPD)
        Connection</td>

        <td width="34%" align="center" valign="top"><a href=
        "printercomm.htm" accesskey="U">Up</a></td>

        <td width="33%" align="right" valign="top">AppSocket TCP/IP
        Protocol</td>
      </tr>
    </table>
  </div>

  <p align="center"></p>
</body>
</html>