@Override
	public void receivePong(Tree message) {

		// Verify protocol version
		if (checkVersion) {
			String ver = message.get("ver", "unknown");
			if (!PROTOCOL_VERSION.equals(ver)) {
				logger.warn("Invalid protocol version (" + ver + ")!");
				return;
			}
		}

		// Get response's unique ID
		String id = message.get("id", (String) null);
		if (id == null || id.isEmpty()) {
			logger.warn("Missing \"id\" property!", message);
			return;
		}

		// Get stored promise
		PendingPromise pending = promises.remove(id);
		if (pending == null) {
			logger.warn("Unknown (maybe timeouted) response received!", message);
			return;
		}

		// Resolve Promise
		pending.promise.complete(message);
	}
@ Override public void receivePong ( Tree message ) { if ( checkVersion ) { String ver = message . get ( "ver" , "unknown" ) ; if ( ! PROTOCOL_VERSION . equals ( ver ) ) { logger . warn ( "Invalid protocol version (" + ver + ")!" ) ; return ; } } String id = message . get ( "id" , ( String ) null ) ; if ( id == null || id . isEmpty ( ) ) { logger . warn ( "Missing \"id\" property!" , message ) ; return ; } PendingPromise pending = promises . remove ( id ) ; if ( pending == null ) { logger . warn ( "Unknown (maybe timeouted) response received!" , message ) ; return ; } pending . promise . complete ( message ) ; }
--- RECEIVE PING-PONG RESPONSE ---