Commit 8bd39885 authored by Junita Sinambela's avatar Junita Sinambela
Browse files

ubah dikit 1

parent 0d30fd8e
......@@ -40,7 +40,9 @@ public class ServerHandler{
request = new String(byt);
if(response != null) {
// request = request.substring(0,count);
listResponses.add(response);
synchronized(this){
addResponse(response);
}
}
s.close();
} catch (IOException ex) {
......@@ -49,6 +51,9 @@ public class ServerHandler{
ServerLogger.log("SERVER_THREAD","Terminated");
}
}
public static void addResponse(String response){
listResponses.add(response);
}
/**
* Create thread to handle request to other server and return expected response that will be given to client in string
* @param request
......
......@@ -6,11 +6,7 @@
package server.helper;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.TimeZone;
/**
*
......@@ -65,7 +61,7 @@ public class Store {
* Update servers list from tracker
* @param list
*/
public static void updateServers(List<IPAddress> list){
public static synchronized void updateServers(List<IPAddress> list){
listServer = list;
}
/**
......
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