Lines Matching refs:timeout
99 private boolean waitForCard(boolean wantPresent, long timeout) throws CardException {
100 if (timeout < 0) {
101 throw new IllegalArgumentException("timeout must not be negative");
103 if (timeout == 0) {
104 timeout = TIMEOUT_INFINITE;
115 // no match, wait (until timeout expires)
116 long end = System.currentTimeMillis() + timeout;
117 while (wantPresent != present && timeout != 0) {
118 // set remaining timeout
119 if (timeout != TIMEOUT_INFINITE) {
120 timeout = Math.max(end - System.currentTimeMillis(), 0l);
122 status = SCardGetStatusChange(contextId, timeout, status, readers);
135 public boolean waitForCardPresent(long timeout) throws CardException {
136 return waitForCard(true, timeout);
139 public boolean waitForCardAbsent(long timeout) throws CardException {
140 return waitForCard(false, timeout);