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

x
?
Solved

Testing Java Sockets on Local Computer

Posted on 2008-06-24
9
Medium Priority
?
370 Views
Last Modified: 2013-11-19
Hello Experts!

I am doing a homework from Distributed Programming, and thus far everything goes fine.

The only way to test my applications is to use the only computer I have as a Client, Server and a Workstation at the same time.

The problem is that I want to check how applications behave when some error happens during the transfer of big files (for example server goes down,...).

Since my client, server and workstation apps reside on the same computer they have the same IP's and the transfers are done immediately, no matter how big files are. I tried to use both localhost and my external IP address, but there is no actual trrafic! Therefore I am not able to simulate above mentioned exceptional situations.

Is there any way to simulate real traffic between two applications on the same computer. I use Java Sockets.

Thank you.
0
Comment
Question by:UrosVidojevic
[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
  • 3
  • 3
  • 2
  • +1
9 Comments
 
LVL 3

Assisted Solution

by:shaz_
shaz_ earned 400 total points
ID: 21856352
well.. not really.. i understand wat ure doing.. i had a similar issue while working on a p2p application... the best u can do is put a thread timeout after every so and so packets transfered.
0
 
LVL 24

Accepted Solution

by:
sciuriware earned 800 total points
ID: 21856641
I would borrow an old laptop or such and connect it UTP-UTP (cross).
The laptop might run LINUX or OSX, no worries.
To make it more critical, run a bunch of virus scans on both machines.
That helped me a lot.

;JOOP!
0
 
LVL 3

Expert Comment

by:shaz_
ID: 21856677
lol love the virus scan idea sciuriware heh.. but yeh ..either its another machine or intentionally put delays on your transfer.. like i mentioned before
0
Simplify Your Workload with One Tool

How do you combat today’s intelligent hacker while managing multiple domains and platforms? By simplifying your workload with one tool. With Lunarpages hosting through Plesk Onyx, you can:

Automate SSL generation and installation with two clicks
Experience total server control

 
LVL 86

Expert Comment

by:CEHJ
ID: 21857141
Why don't you get a friend (or one of us) to run client/server?
0
 
LVL 24

Expert Comment

by:sciuriware
ID: 21857338
Never, never, never put delays intentionally!   Life isn't like that!

I've seen so many "tested" applications fail after seconds in production.

;JOOP!
0
 
LVL 3

Expert Comment

by:shaz_
ID: 21857461
mm well its just to get him started since he does not seem to have another machine... ofc would never say to have an "intentionally delayed" system in production!!
0
 
LVL 86

Assisted Solution

by:CEHJ
CEHJ earned 800 total points
ID: 21857539
In one of your reading loops you can introduce some random fallibility thus:


assert Math.random() < 0.95;

Unless assertions are enabled in the jvm, the lines will simply be ignored, making it easy to turn on and off
0
 
LVL 7

Author Comment

by:UrosVidojevic
ID: 21857677
Thank you very much for your suggestions. My life would be much easier if this could be done on a single machine, but it seems I will have to visit university lab.

Unfortunately I can't send applications to my friends because i need to evaluate results of many test cases and try different failing scenarios. This can last for hours... and I need direct feedback.

In the meantime I will divide transfers into segments with delay, and do some stress testing as you suggested.

Once again thank you.
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 21857734
:-)
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

Color can increase conversions, create feelings of warmth or even incite people to get behind a cause. If you want your website to really impact site visitors, then it is vital to consider the impact color has on them.
When it comes to security, close monitoring is a must. According to WhiteHat Security annual report, a substantial number of all web applications are vulnerable always. Monitis offers a new product - fully-featured Website security monitoring and pr…
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
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