1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 2 3<html> 4 <head> 5 <meta name="generator" content="HTML Tidy, see www.w3.org"> 6 <title>AppSocket TCP/IP Protocol</title> 7 <meta name="GENERATOR" content= 8 "Modular DocBook HTML Stylesheet Version 1.7"> 9 <link rel="HOME" title=" LPRng Reference Manual" href= 10 "index.htm"> 11 <link rel="UP" title="Printer Communication and Protocols " 12 href="printercomm.htm"> 13 <link rel="PREVIOUS" title="Socket API " href="socketapi.htm"> 14 <link rel="NEXT" title="Network Print Server Boxes " href= 15 "secnetwork.htm"> 16 </head> 17 18 <body class="SECT1" bgcolor="#FFFFFF" text="#000000" link= 19 "#0000FF" vlink="#840084" alink="#0000FF"> 20 <div class="NAVHEADER"> 21 <table summary="Header navigation table" width="100%" border= 22 "0" cellpadding="0" cellspacing="0"> 23 <tr> 24 <th colspan="3" align="center">LPRng Reference Manual: 5 25 Sep 2003 (For LPRng-3.8.22)</th> 26 </tr> 27 28 <tr> 29 <td width="10%" align="left" valign="bottom"><a href= 30 "socketapi.htm" accesskey="P">Prev</a></td> 31 32 <td width="80%" align="center" valign="bottom">Chapter 33 11. Printer Communication and Protocols</td> 34 35 <td width="10%" align="right" valign="bottom"><a href= 36 "secnetwork.htm" accesskey="N">Next</a></td> 37 </tr> 38 </table> 39 <hr align="LEFT" width="100%"> 40 </div> 41 42 <div class="SECT1"> 43 <h1 class="SECT1"><a name="APPSOCKET">11.4. AppSocket TCP/IP 44 Protocol</a></h1> 45 46 <p>The AppSocket interface is supported by Tektronix and some 47 other printer vendors. It is similar to the Socket API, with 48 a couple of significant differences.</p> 49 50 <ol type="1"> 51 <li> 52 <p>The printer has two ports for network connections: a 53 TCP port 9100 for TCP/IP stream connections and a UDP 54 port for UDP packet connections.</p> 55 </li> 56 57 <li> 58 <p>When a 0 length UDP packet or a UDP packet containing 59 only <tt class="FILENAME">CR/LF</tt> is sent to UDP port 60 9101, the printer will return a packet to the sender 61 containing print status information. This information 62 indicates the printers current status (busy, idle, 63 printing) and any error conditions.</p> 64 </li> 65 66 <li> 67 <p>The format, reliability, and repeatability of the UDP 68 format and information is totally undocumented, and the 69 UPD port facility should be regarded as, at best, an 70 advisory function of the printer.</p> 71 </li> 72 73 <li> 74 <p>To send a job to the printer, a connection to TCP port 75 is made. This connection will be refused while the 76 printer is busy or has a connection to another host.</p> 77 </li> 78 79 <li> 80 <p>When the TCP connection is established, the 81 information to be printed can be sent over the TCP 82 connection. Bytes sent on this stream will be placed in 83 the input buffer of the Print Engine and processed.</p> 84 </li> 85 86 <li> 87 <p>An end of job (EOJ) sequence indication in the data 88 stream will cause the printer to terminate the 89 connection. This is different than the Socket API, where 90 the printer will keep the connection open. This means 91 that if the PostScript CTRL-D (end of job) character is 92 sent in a job, then the connection will be 93 terminated.</p> 94 </li> 95 96 <li> 97 <p>Some models of printers modify this behavior slightly 98 and will not terminate the connection, but will simply 99 ignore any data following the EOJ indication.</p> 100 </li> 101 102 <li> 103 <p>Some printers support bidirectional AppSocket 104 communication, and while the connection is open will 105 return error indications or status information.</p> 106 </li> 107 108 <li> 109 <p>Once all the data has been received and the job has 110 finished printing, the connection will be terminated by 111 the printer.</p> 112 </li> 113 </ol> 114 <br> 115 <br> 116 117 <p>The <b class="APPLICATION">ifhp</b> filter, one of the 118 helper programs for <b class="APPLICATION">LPRng</b>, is used 119 with <b class="APPLICATION">LPRng</b> to provide AppSocket 120 support. For details, please see the [<span class= 121 "CITATION">IFHP-HOWTO</span>] in the <a href= 122 "http://www.private/" target="_top"><b class= 123 "APPLICATION">ifhp</b> Distribution</a> and <a href= 124 "p450.htm">Tektronix P450 and Family</a> for details. The 125 following is a typical printcap entry for the AppSocket 126 protocol. The actual network connection to the printer is 127 made by the <b class="APPLICATION">ifhp</b> filter:</p> 128 129 <div class="INFORMALEXAMPLE"> 130 <a name="AEN4963"></a> 131<pre class="SCREEN"> 132 lp: 133 # <b class= 134"APPLICATION">LPRng</b> opens a dummy connection for consistency 135 :lp=/dev/null 136 # we pass the ifhp filter options indicating that the 137 # Tektronics printer will need the appsocket protocol 138 # and to use port 35 at 10.0.0.1 to make the connection 139 # The ifhp filter may open and close the connection several 140 # times during the file transfer in order to ensure that 141 # the printer handles the job correctly. 142 :ifhp=model=tek,appsocket,dev=10.0.0.1%35 143 :filter=/usr/local/libexec/filters/ifhp 144</pre> 145 </div> 146 <br> 147 <br> 148 </div> 149 150 <div class="NAVFOOTER"> 151 <hr align="LEFT" width="100%"> 152 153 <table summary="Footer navigation table" width="100%" border= 154 "0" cellpadding="0" cellspacing="0"> 155 <tr> 156 <td width="33%" align="left" valign="top"><a href= 157 "socketapi.htm" accesskey="P">Prev</a></td> 158 159 <td width="34%" align="center" valign="top"><a href= 160 "index.htm" accesskey="H">Home</a></td> 161 162 <td width="33%" align="right" valign="top"><a href= 163 "secnetwork.htm" accesskey="N">Next</a></td> 164 </tr> 165 166 <tr> 167 <td width="33%" align="left" valign="top">Socket API</td> 168 169 <td width="34%" align="center" valign="top"><a href= 170 "printercomm.htm" accesskey="U">Up</a></td> 171 172 <td width="33%" align="right" valign="top">Network Print 173 Server Boxes</td> 174 </tr> 175 </table> 176 </div> 177 </body> 178</html> 179 180