i wrote a rly simple java program that just connects to "localhost" but when
i try running it i get a "Connection Refused" announcement. when connecting
to any other IP outside my home network it says that the connection was mad
e, but trying to connect to a socket on "localhost" or another pc thats on m
y network - connection refused.
i turned off completely window's firewall (xp sp2)and im using port 80, shou
ldn't be blocked by my router.
code:
import java.net.*;
import java.io.*;
public class networkAttempt1 {
public static void main(String[] args) {
String server_name = "localhost" ;
try{
Socket sock = new Socket(server_n ame,80);
System.out.prin tln("---Connected To: "+server_na me+" ---");
}catch (IOException e){
System.err.prin tln("error connecting to " +
server_name + ": " + e);
return;
}
}
}
i try running it i get a "Connection Refused" announcement. when connecting
to any other IP outside my home network it says that the connection was mad
e, but trying to connect to a socket on "localhost" or another pc thats on m
y network - connection refused.
i turned off completely window's firewall (xp sp2)and im using port 80, shou
ldn't be blocked by my router.
code:
import java.net.*;
import java.io.*;
public class networkAttempt1 {
public static void main(String[] args) {
String server_name = "localhost" ;
try{
Socket sock = new Socket(server_n ame,80);
System.out.prin tln("---Connected To: "+server_na me+" ---");
}catch (IOException e){
System.err.prin tln("error connecting to " +
server_name + ": " + e);
return;
}
}
}