*BSD News Article 45961


Return to BSD News archive

Path: sserve!newshost.anu.edu.au!harbinger.cc.monash.edu.au!news.uwa.edu.au!classic.iinet.com.au!tower.itis.com!infoserv.illinois.net!brutus.bright.net!usenet.eel.ufl.edu!netline-fddi.jpl.nasa.gov!elroy.jpl.nasa.gov!swrinde!howland.reston.ans.net!news.sprintlink.net!vodka.intele.net!usenet
From: Barnacle Wes <wes@intele.net>
Newsgroups: comp.unix.bsd.misc
Subject: Re: remote printing problem
Date: 21 Jun 1995 05:19:38 GMT
Organization: The briney, briney deep
Lines: 25
Message-ID: <3s8a5a$5kq@vodka.intele.net>
References: <KSTAILEY.95Jun20183139@leidecker.gsfc.nasa.gov>
NNTP-Posting-Host: slcmodem1-p1-12.intele.net
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Mailer: Mozilla 1.1N (X11; I; BSD/386 uname failed)
X-URL: news:KSTAILEY.95Jun20183139@leidecker.gsfc.nasa.gov

kstailey@leidecker.gsfc.nasa.gov (Kenneth Stailey) wrote:
>Is there any way (short of hacking lpd source code) to make lpd print
>to two different printers that listen on different TCP ports?
>
>I have access to two printers, and one listens on "printer" (port
>515), but the other listens on port 2000 (this is under someone else's
>control and cannot be changed.)  I would like to be able to access
>them both.
>
>It seems that /etc/printcap would be the logical place to list
>alternate ports for remote printers, but even NetBSD doesn't do this.

You could write a simple daemon that opens a pty, collects input from
it and redirects it to the TCP port in question.  You would then use
the pty as the printer port.  I have a book buried somewhere around
here entitled something like "Adventures in UNIX Network Programming"
that mentions this exact strategy and has sample programs.


-- 
   Wes Peters	| Yes I am a pirate, two hundred years too late
    Softweyr 	| The cannons don't thunder, there's nothing to plunder
   Consulting	| I'm an over forty victim of fate...
 wes@intele.net	|					Jimmy Buffet