protected boolean checkConnectionId(String client_address, long id) { try { random_mon.enter(); Long key = new Long(id); connectionData data = (connectionData) connection_id_map.get(key); if (data == null) { // System.out.println( "TRTrackerServerProcessorUDP: rejected:" + id + ", data not found" ); return (false); } else { if (SystemTime.getMonotonousTime() - data.getTime() > CONNECTION_ID_LIFETIME) { return (false); } } boolean ok = data.getAddress().equals(client_address); // System.out.println( "TRTrackerServerProcessorUDP: tested:" + id + "/" + client_address + " // -> " + ok ); return (ok); } finally { random_mon.exit(); } }
private connectionData(String _address, long _id) { address = _address; id = _id; time = SystemTime.getMonotonousTime(); }