private void receiveResponse(final Response response, final RawData raw) { /* * Logging here causes significant performance loss. * If necessary, add an interceptor that logs the messages, * e.g., the MessageTracer. */ for (MessageInterceptor interceptor:interceptors) { interceptor.receiveResponse(response); } // MessageInterceptor might have canceled if (!response.isCanceled()) { Exchange exchange = matcher.receiveResponse(response, raw.getCorrelationContext()); if (exchange != null) { exchange.setEndpoint(CoapEndpoint.this); response.setRTT(System.currentTimeMillis() - exchange.getTimestamp()); coapstack.receiveResponse(exchange, response); } else if (response.getType() != Type.ACK) { LOGGER.log(Level.FINE, "Rejecting unmatchable response from {0}", raw.getInetSocketAddress()); reject(response); } } }
interceptor.receiveResponse(response);