Commit c8107b45 authored by adwisatya's avatar adwisatya
Browse files

Server OK. TInggal map

parent e8f86b1f
......@@ -75,12 +75,13 @@ public class Client extends Thread{
connectionSocket.close();
} catch (IOException ex) {
Logger.getLogger(Client.class.getName()).log(Level.SEVERE, null, ex);
ex.printStackTrace();
}
System.out.println(e);
} catch (NoSuchAlgorithmException ex) {
try {
connectionSocket.close();
} catch (IOException ex1) {
ex1.printStackTrace();
Logger.getLogger(Client.class.getName()).log(Level.SEVERE, null, ex1);
}
Logger.getLogger(Client.class.getName()).log(Level.SEVERE, null, ex);
......
......@@ -38,15 +38,20 @@ public class TCPServer {
// }
// }
ServerSocket mainSocket ;
Socket clientSocket = null;
mainSocket = new ServerSocket(portNumber);
System.out.println("Start listening...");
while(true){
Socket clientSocket = null;
clientSocket = mainSocket.accept();
try{
new Thread(new Client(clientSocket)).start();
}catch(SocketException e){
e.printStackTrace();
}
}
}
public static void cmdJoin() throws IOException, JSONException{
String response = "";
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment