This is right from the VisualAge API Reference:
java.net.*
public Socket(InetAddress address, int port) throws IOException
Creates a stream socket and connects it to the specified port number at the specified IP address.
public InetAddress()
This class represents an Internet Protocol (IP) address.
Applications should use the methods getLocalHost, getByName, or getAllByName to create a new InetAddress instance.
Hope that helps!
You can use the IP address as a string: socket in = new Socket("18.29.1.35", 8189);
Are you sure that you want to connect to 127.0.0.1 from the client? You see, that IP always refers to the current computer - on the client it's the client and on the server it's the server ... Not very useful for you, I think!
Options:
Socket s = new Socket("127.0.0.1", 8189) ;
Socket s = new Socket("localhost", 8189) ;
Here it is assumed that the server you are running is on the same host (PC or computer) on which you are trying to run the client.
Look at the java.net.Socket javadoc for complete info.
Hope this helps !!!