Please enable JavaScript to view this site.

AshLPD Reference

Navigation: Operations

Client Usage

Scroll Prev Top Next More

From the standpoint of the application server, using AshLPD (i.e. printing to an AshLPD-controlled Windows printer) is pretty much the same as printing to any printer. The process starts when the application makes a request to print a file (typically via SPOOL.SBR, EZSPL.SBR, or PRINT.LIT). If the printer name is not specified in the request, then A-Shell retrieves the default printer name from the MIAME.INI file. It then looks for a printer initialization file matching the printer name, either SYS:<printer>.INI or ASHCFG:<printer>.PQI. (The latter is the "approved" location, but the former is preserved for backwards compatibility.)

As A-Shell scans the printer initialization file, it will come upon the COMMAND=SBX:ASHLPR statement, which leads it to call the ASHLPR.SBX subroutine to process the request. ASHLPR.SBX in turn reads the OPR:ASHLPR.INI file to find the IP address and port of the AshLPD server (unless it was passed directly as an argument to ASHLPR), and then tries to connect to the server to transfer the file.

If the connection is accepted, then the file is transferred and the process is considered complete, at least from the standpoint of the application. (The print request returns to the application, which continues on its merry way.)

If the connection is not accepted, then ASHLPR retries a couple of times, at one second intervals (in case the AshLPD server is temporarily busy). If still no success and the AshLPD server IP was not specified on the ASHLPR command line, then it checks to see if there was a backup server defined in the ASHLPR.INI file. If so, then it tries to connect to it; again, up to 3 times spaced 1 second apart.

Windows boxes can sometimes be  slow to react to a client attempting an invalid connection. This is probably a security measure to discourage automated programs from attempting to connect at every open port, but it has the side effect of making the above procedure of retrying quite slow. A subsequent version of ASHLPR will probably get around this by moving the entire operation to a background task.

If still no connection after all these tries, it pops up a message box to inform the user of the problem, and to present the choice to R)etry, Q)ueue for later, or C)ancel.

The Cancel option causes the request to be discarded and the process to return to the application.

The Queue for later option causes the file to be stored in the ASHLPR: working directory, along with an entry in a special ASHLPR.LOG file indicating the details of the request. The next print request that succeeds will automatically check the working directory and log to see if there are any queued requests, and if so, will transmit them at that time.