hi all


M

mamta81

i want to print some files in a linux server using sockets.i hav used
the following code
sbr= new BufferedReader(new InputStreamReader(s.getInputStream()));
while(!sbr.ready())
Thread.sleep(500);
String command=sbr.readLine();
Process process=r.exec(command); where the command is
lpr -Plp1 Loan.RPT which will be sent from the client pc. The client
is in windows. Please help
Thanx
 
Ad

Advertisements

R

Roedy Green

i want to print some files in a linux server using sockets.i hav used
the following code
sbr= new BufferedReader(new InputStreamReader(s.getInputStream()));
while(!sbr.ready())
Thread.sleep(500);
String command=sbr.readLine();
Process process=r.exec(command); where the command is
lpr -Plp1 Loan.RPT which will be sent from the client pc. The client
is in windows. Please help

I think you would be better off waiting until you had accumulated the
entire file before printing. Otherwise you may get just tiny dribbles
at a time, which will tie up your printer for hours. Execing to print
will likely start a fresh page for each burst. See
http://mindprod.com/jgloss/printing.html

See the code in the com.mindprod.http package to read a socket input
stream coming in a bit at a time. See
http://mindprod.com/products1.html#HTTP
and also
http://mindprod.com/products1.html#FILETRANSFER
 

Top