public synchronized JSONObject read() throws IOException, ProtocolException {
	String line = connection.readLine();
	JSONObject obj = null;
	if(line == null){
	    return null;
	}
	try {
	    obj = new JSONObject(line);
	    return obj;
	}
	catch (JSONException e){
	    throw new ProtocolException("Invalid packet received: " + e.getMessage());
	}
    }