user2450099
user2450099

Reputation: 385

Java networking: how to simulate two different computers?

I want to start network programming in Java. What's the best way to go about it in terms of testing? If I write a client and server program, I'd obviously want to test them in either a real or simulated network environment, but I only have one computer.

Am I missing something or is there a standard tool used for this?

Upvotes: 0

Views: 993

Answers (4)

Ondra Žižka
Ondra Žižka

Reputation: 46816

You don't need a virtual machine; you can create a virtual interface, that's much easier and won't eat half of your RAM.

http://www.lazysystemadmin.com/2010/05/add-virtual-interfaces-in-linux-quick.html

Upvotes: 0

Chris
Chris

Reputation: 78

Use local port for both server and clients to connect to. You can simulate multiple machines easily.

Upvotes: 1

JavaHawk
JavaHawk

Reputation: 1

if you cannot get another machine i would first get both client and servers working on the same machine and perhaps eventually use one or more vmware images to simulate things more.

Upvotes: 0

ceilfors
ceilfors

Reputation: 2727

You can try to use virtual machine e.g. VirtualBox.

Upvotes: 0

Related Questions