Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Client/Server through-put

Posted on 1997-04-02
2
Medium Priority
?
239 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

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…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
The viewer will learn how to implement Singleton Design Pattern in Java.
Suggested Courses

610 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