Hi guys,
I am running a server on the local host and want my client to connect to it.It is unable to connect and I get a connection refused error.I was running a firewall which I shutdown and tried but still did not make any headway.
The code is as below
-------------------------------------------
try { // initialize socket
this.remoteAddr = remoteAddr;
this.port = port;
socket = new Socket(remoteAddr, port);
out = new PrintStream(socket.getOutputStream());
in = new BufferedReader(new InputStreamReader(socket.getInputStream()));
}
catch (Exception e) {
System.out.println(e);
JOptionPane.showMessageDialog(null,
"Could not connect to server, aborting...!");
System.exit(0);
}
----------------------------
I am running a server on the local host and want my client to connect to it.It is unable to connect and I get a connection refused error.I was running a firewall which I shutdown and tried but still did not make any headway.
The code is as below
-------------------------------------------
try { // initialize socket
this.remoteAddr = remoteAddr;
this.port = port;
socket = new Socket(remoteAddr, port);
out = new PrintStream(socket.getOutputStream());
in = new BufferedReader(new InputStreamReader(socket.getInputStream()));
}
catch (Exception e) {
System.out.println(e);
JOptionPane.showMessageDialog(null,
"Could not connect to server, aborting...!");
System.exit(0);
}
----------------------------