I Keep getting a connection refused... its all on localhost I cant figure out what I am doing wrong!? When Client tries to connect it looks like srvr.accept() is getting called, and its performing some desired functionality unable to read the output stream however...
My Client:
//Create Socket Connection to Server
Socket skt = new Socket("localhost", 855);
//Retrieve Input Stream from Socket
InputStreamReader in = new InputStreamReader(skt.getInputStream());
//Setup Buffer Reader and wait for Input from Server
BufferedReader br = new BufferedReader(in);
//Create Strings for Buffer Input
String next = "";
String response = "";
//read first line of respone from Server
response = br.readLine();
//Use Loop to read through entire buffer and not just the first line
while((next = br.readLine()) != null){
response += next;
}
//Close Buffer
br.close();
in.close();
skt.close();
My Server:
srvr = new ServerSocket(855);
while(true){
try{
//Listen for Client Connections
skt = srvr.accept();
}
catch(Exception e){}
}