Creating Socket Issue
hey, i'm pretty new at this networking stuff in java and i was wondering
if someone could tell me how to do this.
My command line arguments for the client in this java program i'm writing contain the server ipAddress which is args and the port number args
But i'm not sure how to convert the server "IpAdress" args into an InetAddress so i can create the socket.
This is my failed attempt, might give you a better idea of what i'm trying to do.
clientSocket = new Socket((InetAddress)args, Integer.parseInt(args));
The args is not similar to c++. In java the first argument is counted as args and the second argument is counted as args. Try to print this using System.out.println(args) before considering it for ipaddress.
for online java tutorial visit :: Java Needs - Java Programmers' Website ::
for project dreams visit Webarch Technologies
Well you can't cast a String to an InetAddress.
See the specs for details on how to use it.