@Override public synchronized void shutdown() { closed = true; if (callSender != null) { callSender.interrupt(); } closeConn(new IOException("connection to " + remoteId.address + " closed")); }
private synchronized boolean waitForWork() { // beware of the concurrent access to the calls list: we can add calls, but as well // remove them. long waitUntil = EnvironmentEdgeManager.currentTime() + this.rpcClient.minIdleTimeBeforeClose; for (;;) { if (thread == null) { return false; } if (!calls.isEmpty()) { return true; } if (EnvironmentEdgeManager.currentTime() >= waitUntil) { closeConn( new IOException("idle connection closed with " + calls.size() + " pending request(s)")); return false; } try { wait(Math.min(this.rpcClient.minIdleTimeBeforeClose, 1000)); } catch (InterruptedException e) { } } }
closeConn(e); return;
@Override public synchronized void shutdown() { closed = true; if (callSender != null) { callSender.interrupt(); } closeConn(new IOException("connection to " + remoteId.address + " closed")); }
private synchronized boolean waitForWork() { // beware of the concurrent access to the calls list: we can add calls, but as well // remove them. long waitUntil = EnvironmentEdgeManager.currentTime() + this.rpcClient.minIdleTimeBeforeClose; for (;;) { if (thread == null) { return false; } if (!calls.isEmpty()) { return true; } if (EnvironmentEdgeManager.currentTime() >= waitUntil) { closeConn( new IOException("idle connection closed with " + calls.size() + " pending request(s)")); return false; } try { wait(Math.min(this.rpcClient.minIdleTimeBeforeClose, 1000)); } catch (InterruptedException e) { } } }
closeConn(e); return;
@Override public synchronized void shutdown() { closed = true; if (callSender != null) { callSender.interrupt(); } closeConn(new IOException("connection to " + remoteId.address + " closed")); }
private synchronized boolean waitForWork() { // beware of the concurrent access to the calls list: we can add calls, but as well // remove them. long waitUntil = EnvironmentEdgeManager.currentTime() + this.rpcClient.minIdleTimeBeforeClose; for (;;) { if (thread == null) { return false; } if (!calls.isEmpty()) { return true; } if (EnvironmentEdgeManager.currentTime() >= waitUntil) { closeConn( new IOException("idle connection closed with " + calls.size() + " pending request(s)")); return false; } try { wait(Math.min(this.rpcClient.minIdleTimeBeforeClose, 1000)); } catch (InterruptedException e) { } } }