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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top