× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hi All

First off, I'd like to say thanks to Scott Klement for pointing me in the right
direction on my HP DirectJet issue a few weeks ago.  Sorry about being so late
in thanking you, Scott.

Well, after a couple of weeks of diddling around with some ILE RPG TCP/IP code,
I finally got something that would write to the DirectJet, no problems.  Now
the next challenge:  LPR.

Because I know nothing about this stuff, I took Mr. Klement's suggestion,
scored a copy of Ethereal and sniffed the network traffic between our AS/400
and an LPR printer queue I have configured on my PC.  I looked at the output of
the sniffer session, found some recognizable text (namely the remote printer
queue, and the printed data).

To figure out the format of the LPR commands that were identified by Ethereal,
I started looking at RCF1179 which specifies the format of all of the LPR
commands.  (I know, I shoulda figured it out weeks ago, but I am slow.)

The RFC itself isn't too long, but it seems kinda involved.  I'd like to avoid
writing a bunch of code to format LPR requests, if possible.  For example,
initiate an LPR printer session, I have to:

1. Contact the LPR service on the target box
2. Send a transfer printer job/receieve control file
3. Wait for an ack from the service
4. Send print short form/receive data file
5. Wait for an ack from the service
6. Send the data to the service
   (LPR sends data to the printer immedately, no spooling.)
   (LPR receives an ack from the printer)
7. LPR sends a "printer ack".
8. Repeat either 2-7 or 6-7 as needed.
9. Close the connection to the LPR service.

I have two questions about this:

1.  Has anyone done this before (written an RPG, C, or Java program to talk LPR
over a socket)?  What were the pitfalls?  What problems did you encounter?
2.  The RFC is a little thin on how LPD is supposed to behave, specifically
with errors.  The RFC that says the LPR returns a 0 for success, and a non-zero
for failure.  What I'm trying to figure out is if I write code to support the
scheme I've just mentioned, what happens if I turn the printer off halfway
through a large document?  (Assume spooling is turned off.)  Will the non-zero
return code be sent back to the AS/400?  (I'm skeptical that it will-- if
you're printing a large document through LPR over a remote output queue, and
turn the printer off halfway through a print session, the spool file in the
remote outq gets 'jammed' with a status of 'SND'... and never seems to time
out.)

Any ideas?

Thanks

-Doc


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.