463464465466467468469470471472473
if (!tryLock(5, TimeUnit.SECONDS)) { return; } try { connection.sendPacket(new Ping()); } catch (NotConnectedException e) { // connection died, so lets scheduled task die, too throw new RuntimeException(e); } finally { unlock();