?
Solved

Client/Server through-put

Posted on 1997-04-02
2
Medium Priority
?
234 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 140 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

Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

Question has a verified solution.

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

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Suggested Courses

770 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