tags:

views:

56

answers:

2

I need to run a setup on my windows machine with 1 master and 2 workers on the same machine. I have setup the master to run on port 1111 and workers to run on 2222 & 2223. How can i access these ports to run my programs? I dont want to install VmWare or any virtual desktop.

I want to know how can I run a program on a specific port of my machine. If it requires a socket program, can someone provide a sample JAVA API for the same?

A: 

The Java Sockets API will allow you to specify the port number.

See here: http://download.oracle.com/javase/6/docs/api/java/net/Socket.html#Socket%28java.net.InetAddress,%20int%29

FrustratedWithFormsDesigner
+7  A: 

You cannot run a program on a Port, what you can do is make your program listen to a port. Check this tutorial from Oracle for more information regarding Java Sockets

npinti
Sun? You mean Oracle? (but the unwise one though, since they're suing Google for Dalvik). LOL
The Elite Gentleman
making my program listen to the port isnt going to work for me..i need to simulate a master-slave setup and different program has to be run on the master and slave machines.
Andy
@The Elite Gentleman: Yeah you are right, it is a matter of habbit lol. @user462203: If that is the case, then, you need to give a more detailed explenation.
npinti