Solved

Client/Server through-put

Posted on 1997-04-02
2
187 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…

706 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