Connecting to Telent on local machine
Is this code right - well it compiles but throws an error saying that "ConnectException:Connection refused" - how do I get round this, all I want to do is connect to Telnet on my computer (local). Surely it cant be that hard!!!
public static void main (String args[]) throws IOException {
{ try
{InetAddress ina = InetAddress.getLocalHost();
System.out.println(ina);
Socket s = new Socket(ina, 23);
BufferedReader in = new BufferedReader(new InputStreamReader(s.getInputStream()));
boolean more = true;
while (more)
{ String line = in.readLine();
if (line == null) more = false;
else
System.out.println(line);
}
}
catch (IOException e)
{ System.out.println("Error" + e);
}
}
}
}

