i am writing a java printer control program to remotely control print jobs on a linux (readhat v7.0) print server running lprng (v3.8.3).
 
here's my code snippet:
 
protected static final byte     QUEUE_STATUS_VERBOSE = (byte) 0x09;
protected static final byte     LF = (byte) '\n';
protected static final String   PRINT_QUEUE_ALL = "all";
...
Connect();
 
// send a status request command
OutputStream outputStream = _socket.getOutputStream();
 
Write(outputStream,QUEUE_STATUS_VERBOSE );
Write(outputStream,PRINT_QUEUE_ALL);
Write(outputStream,LF);
 
// read the result
InputStream inputStream = _socket.getInputStream();
String inputLine = Read(inputStream);
 
_socket.close();

The Connect() and Write()'s run very quickly. However, when it gets to the Read(), it takes about 3-5 seconds to get the response back from lprng. the two computers are connected to the same network switch - so it's not network latency.
 
i really need almost instantaneous response. how do i get lprng to respond quickly (say within 1 second or less) to this request?
 
here's my printcap file.
 
 
# this is the queue that sends the job to the printer.
# do not print to this queue. print to lpgk instead.
 
lpgkq:client
  :force_localhost=0
 
lpgkq:server
  :sd=/var/spool/lpd/%P
  :done_jobs=0
  :mx=0
  :mc=0
  :sh
  :lp=192.168.1.250%9100
  :filter=/usr/local/libexec/filters/ifhp
  :ifhp=model=hp2100
  :lpd_port=515
  :reuse_addr=1
  :retry_econnrefused=1
  :retry_nolink=1
  :socket_linger=0
  :originate_port=512 1023
 

# this is the queue that checks the job to make sure it can
# be printed, then it forwards it on to the printer queue
 
lpgk:
  :client
  :force_localhost=1
 
lpgk:
  :server
  :lpd_bounce=1
  :as=|/usr/local/LinuxGateKeeper/LinuxGateKeeperPrintJobFilter.sh
  :sd=/var/spool/lpd/%P
  :done_jobs=5
  :done_jobs_max_age=3600
  :mx=0
  :mc=0
  :sh
  :lp=lpgkq@localhost
 

Regards,

Floyd Shackelford
4 Peaks Technology Group, Inc.
VOICE: 334.735.9428
FAX:   916.404.7125
EMAIL:
[EMAIL PROTECTED]

acta non verba

 

Reply via email to