× 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.



On Wed, 2004-04-21 at 17:53, EDoxtator wrote:

> 
> 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.
> 
Huh?  Why would anyone need to write code to support LPR on the
iSeries?  It's already supported.  All you have to do is create the
proper output queue, and the iSeries will manage the LPR conversation.  

The iSeries also runs LPD, and can accept print jobs from other LPR
clients.

> 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?
Yes.  I wrote an LPD server some years ago that ran on windoze so that I
could spool files to my local printer from a remote AS/400.  Wrote it in
Delphi.

Pitfalls? I didn't understand how to make a multithreaded socket server
at that time.  While my program worked fine for me, if multiple clients
were to contact it, it would have had serious problems.

The LPD protocol is quite simple and straightforward.  Remember, most of
the internet protocols like FTP, telnet, SMTP and the like, including
LPR/LPD, were developed at a time when computing resources were
limited.  Protocols had to be simple or they wouldn't work. 


> 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.)
That probably depends on the implementation of the LPD portion of the
server.  Some LPD servers might not time out properly.  


--
Regards,
Rich

Current Conditions in Des Moines, IA
Overcast
Temp 53.6F
Winds out of the East at 10mph


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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.