Very new to Java. My guess is it should be new Socket ("nothing",8)?
public static void test(String s[]) {
try {
echoSocket = new Socket("nothing", 7);
out = new PrintWriter(echoSocket.getOutputStream(), true);
in = new BufferedReader( new InputStreamReader(echoSocket.getInputStream()));
} catch (UnknownHostException e) {
System.err.println("Don't know about host: .");
return;
}
process(out, in, echoSocket);
out.close();
in.close();
echoSocket.close();
}
It depends on what you are trying to accomplish. From the Java docs on Socket, if your server is nothing, and your port is 8, you are correct. But not knowing what you are trying to connect to, it’s impossible to debug this code.