reconnect(link);
return;
}
final PingCommand ping = _resource.getCurrentStatus(getId());
final Request request = new Request(_id, -1, ping, false);
request.setSequence(getNextSequence());
if (s_logger.isDebugEnabled()) {
s_logger.debug("Sending ping: " + request.toString());
}
try {
task.getLink().send(request.toBytes());
//if i can send pingcommand out, means the link is ok
setLastPingResponseTime();
} catch (final ClosedChannelException e) {
s_logger.warn("Unable to send request: " + request.toString());
}
} else if (obj instanceof Request) {
final Request req = (Request) obj;
final Command command = req.getCommand();
Answer answer = null;
_inProgress.incrementAndGet();
try {
answer = _resource.executeRequest(command);
} finally {