Solved

Client/Server through-put

Posted on 1997-04-02
2
201 Views
Last Modified: 2010-04-16
I currently use datainputstream and printstream for my
server and get two requests per second.
I have seen a program which uses bytes in a dataoutputstream(??) is that faster?

I set up the streams like so:

try {
dis = new DataInputStream( theSock.getInputStream());
ps = new PrintStream( theSock.getOutputStream());
} catch (Exception e);

And scan the client inputl lke this:
 
while (theSock !=null) {
String input = null;
try {
input = dis.readLine().trim();
if(input != null)
      parent.handleInput(input, this);        

} catch (Exception e);
}

Which raises another question.
In my client executions stops and waits for a
 'dis.readLine().trim(); does the above also?

0
Comment
Question by:sty
2 Comments
 

Author Comment

by:sty
ID: 1219377
I want to know the fastest way to get data going from clients to server and to clients- for awesome games of course.

0
 
LVL 2

Accepted Solution

by:
majkl earned 70 total points
ID: 1219378
Well. They aren't very fast because Java is interpet language. But I can asure you both are pretty same. I have worked with both and landed with PrintStream and DataInputStream
I have made one observation tool for computers and it send huge amount of data from Server to Clients and it works pretty quick.
I haven't do optimization, which would be good, but  runs fast.
So there is no need to worry about speed.

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Java / Linux and Regular Expressions 11 71
object oriented programming comparison 5 55
how to add new optional parameter to JSP 1 29
javap not working 8 38
For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now