Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / November 2007

Tip: Looking for answers? Try searching our database.

hi all

Thread view: 
mamta81 - 21 Nov 2007 10:25 GMT
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
Roedy Green - 21 Nov 2007 23:10 GMT
On Wed, 21 Nov 2007 02:25:20 -0800 (PST), mamta81
<roy.mamta@gmail.com> wrote, quoted or indirectly quoted someone who
said :

>i want to print some files in a linux server using sockets.i hav used
>the following code
[quoted text clipped - 5 lines]
>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

Signature

Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.