LOG.warning("Received ZMQ.HANDSHAKE_RESPONSE for unknown handshake..."
+ senderUrl + " : " + token);
}
return;
} else {
final ObjectCache sessionCache = ObjectCache.get("ZMQSessions");
if (!sessionCache.containsKey(key) && doesAuthentication) {
final SyncCallback<String> callback = new SyncCallback<String>(){};
CALLBACKS.push(key, "", callback);
sendAsync(ZMQ.HANDSHAKE, token.toString(), senderUrl, token
.getTime().getBytes(), null);
String retToken = null;
try {
retToken = callback.get();
} catch (final Exception e) {
}
if (token.getToken().equals(retToken)) {
sessionCache.put(key, true);
} else {
LOG.warning("Failed to complete handshake!");
return;
}
}