hi all

Discussion in 'Java' started by mamta81, Nov 21, 2007.

  1. mamta81

    mamta81 Guest

    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
     
    mamta81, Nov 21, 2007
    #1
    1. Advertisements

  2. mamta81

    Roedy Green Guest

    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
     
    Roedy Green, Nov 21, 2007
    #2
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.
Similar Threads
Loading...