org.eclipse.californium.core.network.Exchange Java Examples
The following examples show how to use
org.eclipse.californium.core.network.Exchange.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: CocoaStrong.java From SI with BSD 2-Clause "Simplified" License | 6 votes |
@Override public void processRTTmeasurement(long measuredRTT, Exchange exchange, int retransmissionCount){ //System.out.println("Measured an RTT of " + measuredRTT + " after using " + retransmissionCount + " retries." ); RemoteEndpoint endpoint = getRemoteEndpoint(exchange); int rtoType = endpoint.getExchangeEstimatorState(exchange); if(rtoType == NOESTIMATOR || rtoType == WEAKRTOTYPE) return; endpoint.matchCurrentRTO(); //System.out.println("Measured RTT:" + measuredRTT); // System.out.println("Endpoint status: blindweak/blindstrong/state : " + endpoint.isBlindWeak() + "/" + endpoint.isBlindStrong() + "/" + endpoint.getExchangeEstimatorState(exchange)); if (endpoint.isBlindStrong() && rtoType == STRONGRTOTYPE) { // Received a strong RTT measurement for the first time, apply // strong RTO update endpoint.setBlindStrong(false); initializeRTOEstimators(measuredRTT, STRONGRTOTYPE, endpoint); } else { // Perform normal update of the RTO updateEstimator(measuredRTT, rtoType, endpoint); } }
Example #2
Source File: CoapResource.java From SI with BSD 2-Clause "Simplified" License | 6 votes |
/** * This method is used to apply resource-specific knowledge on the exchange. * If the request was successful, it sets the Observe option for the * response. It is important to use the notificationOrderer of the resource * here. Further down the layer, race conditions could cause local * reordering of notifications. If the response has an error code, no * observe relation can be established and if there was one previously it is * canceled. When this resource allows to be observed by clients and the * request is a GET request with an observe option, the * {@link ServerMessageDeliverer} already created the relation, as it * manages the observing endpoints globally. * * @param exchange the exchange * @param response the response */ public void checkObserveRelation(Exchange exchange, Response response) { /* * If the request for the specified exchange tries to establish an observer * relation, then the ServerMessageDeliverer must have created such a relation * and added to the exchange. Otherwise, there is no such relation. * Remember that different paths might lead to this resource. */ ObserveRelation relation = exchange.getRelation(); if (relation == null) return; // because request did not try to establish a relation if (CoAP.ResponseCode.isSuccess(response.getCode())) { response.getOptions().setObserve(notificationOrderer.getCurrent()); if (!relation.isEstablished()) { relation.setEstablished(true); addObserveRelation(relation); } else if (observeType != null) { // The resource can control the message type of the notification response.setType(observeType); } } // ObserveLayer takes care of the else case }
Example #3
Source File: ReliabilityLayer.java From SI with BSD 2-Clause "Simplified" License | 6 votes |
/** * When we receive a Confirmable response, we acknowledge it and it also * counts as acknowledgment for the request. If the response is a duplicate, * we stop it here and do not forward it to the upper layer. */ @Override public void receiveResponse(Exchange exchange, Response response) { exchange.setFailedTransmissionCount(0); exchange.getCurrentRequest().setAcknowledged(true); LOGGER.finest("Cancel any retransmission"); exchange.setRetransmissionHandle(null); if (response.getType() == Type.CON && !exchange.getRequest().isCanceled()) { LOGGER.finer("Response is confirmable, send ACK"); EmptyMessage ack = EmptyMessage.newACK(response); sendEmptyMessage(exchange, ack); } if (response.isDuplicate()) { LOGGER.fine("Response is duplicate, ignore it"); } else { super.receiveResponse(exchange, response); } }
Example #4
Source File: ServerMessageDeliverer.java From SI with BSD 2-Clause "Simplified" License | 6 votes |
@Override public void deliverRequest(final Exchange exchange) { Request request = exchange.getRequest(); List<String> path = request.getOptions().getUriPath(); final Resource resource = findResource(path); if (resource != null) { checkForObserveOption(exchange, resource); // Get the executor and let it process the request Executor executor = resource.getExecutor(); if (executor != null) { exchange.setCustomExecutor(); executor.execute(new Runnable() { public void run() { resource.handleRequest(exchange); } }); } else { resource.handleRequest(exchange); } } else { LOGGER.info("Did not find resource " + path.toString() + " requested by " + request.getSource()+":"+request.getSourcePort()); exchange.sendResponse(new Response(ResponseCode.NOT_FOUND)); } }
Example #5
Source File: AbstractVertxBasedCoapAdapterTest.java From hono with Eclipse Public License 2.0 | 6 votes |
private static CoapExchange newCoapExchange(final Buffer payload, final Type requestType, final OptionSet options) { final Request request = mock(Request.class); when(request.getType()).thenReturn(requestType); when(request.isConfirmable()).thenReturn(requestType == Type.CON); when(request.getOptions()).thenReturn(options); final Exchange echange = new Exchange(request, Origin.REMOTE, mock(Executor.class)); final CoapExchange coapExchange = mock(CoapExchange.class); when(coapExchange.advanced()).thenReturn(echange); Optional.ofNullable(payload).ifPresent(b -> when(coapExchange.getRequestPayload()).thenReturn(b.getBytes())); when(coapExchange.getRequestOptions()).thenReturn(options); when(coapExchange.getQueryParameter(anyString())).thenAnswer(invocation -> { final String key = invocation.getArgument(0); return options.getUriQuery().stream() .map(param -> param.split("=", 2)) .filter(keyValue -> key.equals(keyValue[0])) .findFirst() .map(keyValue -> keyValue.length < 2 ? Boolean.TRUE.toString() : keyValue[1]) .orElse(null); }); return coapExchange; }
Example #6
Source File: CropRotation.java From SI with BSD 2-Clause "Simplified" License | 5 votes |
@Override public Exchange findPrevious(KeyMID key, Exchange exchange) { int f = first; int s = second; Exchange prev = maps[f].putIfAbsent(key, exchange); if (prev != null || f==s) return prev; prev = maps[s].putIfAbsent(key, exchange); return prev; }
Example #7
Source File: Cocoa.java From SI with BSD 2-Clause "Simplified" License | 5 votes |
@Override public void processRTTmeasurement(long measuredRTT, Exchange exchange, int retransmissionCount) { //System.out.println("Measured an RTT of " + measuredRTT + " after using " + retransmissionCount + " retries." ); RemoteEndpoint endpoint = getRemoteEndpoint(exchange); int rtoType = endpoint.getExchangeEstimatorState(exchange); if(rtoType == NOESTIMATOR) return; endpoint.matchCurrentRTO(); //System.out.println("Measured RTT:" + measuredRTT); // System.out.println("Endpoint status: blindweak/blindstrong/state : " + endpoint.isBlindWeak() + "/" + endpoint.isBlindStrong() + "/" + endpoint.getExchangeEstimatorState(exchange)); if (endpoint.isBlindWeak() && rtoType == WEAKRTOTYPE) { // Received a weak RTT for the first time, apply weak RTO update endpoint.setBlindWeak(false); initializeRTOEstimators(measuredRTT, WEAKRTOTYPE, endpoint); } else if (endpoint.isBlindStrong() && rtoType == STRONGRTOTYPE) { // Received a strong RTT measurement for the first time, apply strong RTO update endpoint.setBlindStrong(false); initializeRTOEstimators(measuredRTT, STRONGRTOTYPE, endpoint); } else { // Perform normal update of the RTO updateEstimator(measuredRTT, rtoType, endpoint); } }
Example #8
Source File: CongestionControlLayer.java From SI with BSD 2-Clause "Simplified" License | 5 votes |
@Override public void receiveResponse(Exchange exchange, Response response) { //August: change the state of the remote endpoint (STRONG/WEAK/NOESTIMATOR) if failedTransmissionCount = 0; if (exchange.getFailedTransmissionCount() != 0) { getRemoteEndpoint(exchange).setEstimatorState(exchange); } super.receiveResponse(exchange, response); calculateRTT(exchange); checkRemoteEndpointQueue(exchange); }
Example #9
Source File: BlockwiseLayer.java From SI with BSD 2-Clause "Simplified" License | 5 votes |
/** * Schedules a clean-up task. Use the BLOCKWISE_STATUS_LIFETIME config * property to set the timeout. * * @param exchange * the exchange */ protected void prepareBlockCleanup(Exchange exchange) { // prevent RejectedExecutionException if (executor.isShutdown()) { LOGGER.info("Endpoint is being destroyed: skipping block clean-up"); return; } BlockCleanupTask task = new BlockCleanupTask(exchange); ScheduledFuture<?> f = executor.schedule(task , block_timeout, TimeUnit.MILLISECONDS); exchange.setBlockCleanupHandle(f); }
Example #10
Source File: TracingSupportingHonoResourceTest.java From hono with Eclipse Public License 2.0 | 5 votes |
/** * Verifies that the resource does not set a parent on the newly created Span if the CoAP request * does not contain a trace context option. */ @Test public void testExtractFromEmptyOptionSet() { final Request request = new Request(Code.POST); final Exchange exchange = new Exchange(request, Origin.REMOTE, mock(Executor.class)); resource.handleRequest(exchange); verify(tracer, never()).extract(eq(Format.Builtin.BINARY), any(Binary.class)); verify(tracer).buildSpan(eq(Code.POST.toString())); verify(spanBuilder).withTag(eq(Tags.SPAN_KIND.getKey()), eq(Tags.SPAN_KIND_SERVER.toString())); verify(spanBuilder).addReference(eq(References.CHILD_OF), isNull()); }
Example #11
Source File: CongestionControlLayer.java From SI with BSD 2-Clause "Simplified" License | 5 votes |
/** * Forward the request to the lower layer. * @param exchange the exchange * @param request the current request */ @Override public void sendRequest(Exchange exchange, Request request) { // Check if exchange is already running into a retransmission; if so, don't call processMessage if (exchange.getFailedTransmissionCount() > 0) { super.sendRequest(exchange, request); } else if (processMessage(exchange, request)) { checkAging(exchange); super.sendRequest(exchange, request); } }
Example #12
Source File: ServerMessageDeliverer.java From SI with BSD 2-Clause "Simplified" License | 5 votes |
@Override public void deliverResponse(Exchange exchange, Response response) { if (response == null) throw new NullPointerException(); if (exchange == null) throw new NullPointerException(); if (exchange.getRequest() == null) throw new NullPointerException(); exchange.getRequest().setResponse(response); }
Example #13
Source File: ObserveRelation.java From SI with BSD 2-Clause "Simplified" License | 5 votes |
/** * Constructs a new observe relation. * * @param endpoint the observing endpoint * @param resource the observed resource * @param exchange the exchange that tries to establish the observe relation */ public ObserveRelation(ObservingEndpoint endpoint, Resource resource, Exchange exchange) { if (endpoint == null) throw new NullPointerException(); if (resource == null) throw new NullPointerException(); if (exchange == null) throw new NullPointerException(); this.endpoint = endpoint; this.resource = resource; this.exchange = exchange; this.established = false; this.key = getSource().toString() + "#" + exchange.getRequest().getTokenString(); }
Example #14
Source File: CongestionControlLayer.java From SI with BSD 2-Clause "Simplified" License | 5 votes |
private void calculateRTT(Exchange exchange){ long timestamp, measuredRTT; timestamp = getRemoteEndpoint(exchange).getExchangeTimestamp(exchange); if (timestamp != 0){ measuredRTT = System.currentTimeMillis() - timestamp; // process the RTT measurement processRTTmeasurement(measuredRTT, exchange, exchange.getFailedTransmissionCount()); getRemoteEndpoint(exchange).removeExchangeInfo(exchange); } }
Example #15
Source File: BlockwiseLayer.java From SI with BSD 2-Clause "Simplified" License | 5 votes |
private BlockwiseStatus findResponseBlockStatus(Exchange exchange, Response response) { BlockwiseStatus status = exchange.getResponseBlockStatus(); if (status == null) { status = new BlockwiseStatus(response.getOptions().getContentFormat()); status.setCurrentSzx( computeSZX(preferred_block_size) ); exchange.setResponseBlockStatus(status); LOGGER.finer("There is no blockwise status yet. Create and set new Block2 status: "+status); } else { LOGGER.finer("Current Block2 status: "+status); } // sets a timeout to complete exchange prepareBlockCleanup(exchange); return status; }
Example #16
Source File: BlockwiseLayer.java From SI with BSD 2-Clause "Simplified" License | 5 votes |
private BlockwiseStatus findRequestBlockStatus(Exchange exchange, Request request) { BlockwiseStatus status = exchange.getRequestBlockStatus(); if (status == null) { status = new BlockwiseStatus(request.getOptions().getContentFormat()); status.setCurrentSzx( computeSZX(preferred_block_size) ); exchange.setRequestBlockStatus(status); LOGGER.finer("There is no assembler status yet. Create and set new Block1 status: "+status); } else { LOGGER.finer("Current Block1 status: "+status); } // sets a timeout to complete exchange prepareBlockCleanup(exchange); return status; }
Example #17
Source File: CongestionControlLayer.java From SI with BSD 2-Clause "Simplified" License | 5 votes |
private void checkRemoteEndpointQueue(Exchange exchange) { // 0 = empty queue | 1 = response | 2 = request if (!getRemoteEndpoint(exchange).getConfirmableQueue().isEmpty()) { // We have some exchanges that need to be processed; is it a // response or a request? Exchange queuedExchange = getRemoteEndpoint(exchange).getConfirmableQueue().poll(); if (queuedExchange.getCurrentResponse() != null) { // it's a response sendResponse(queuedExchange, queuedExchange.getCurrentResponse()); } else if (queuedExchange.getCurrentRequest() != null) { // it's a request sendRequest(queuedExchange, queuedExchange.getCurrentRequest()); } } }
Example #18
Source File: BlockwiseLayer.java From SI with BSD 2-Clause "Simplified" License | 5 votes |
private BlockwiseStatus findResponseBlockStatus(Exchange exchange, Response response) { BlockwiseStatus status = exchange.getResponseBlockStatus(); if (status == null) { status = new BlockwiseStatus(response.getOptions().getContentFormat()); status.setCurrentSzx( computeSZX(preferred_block_size) ); exchange.setResponseBlockStatus(status); LOGGER.finer("There is no blockwise status yet. Create and set new Block2 status: "+status); } else { LOGGER.finer("Current Block2 status: "+status); } // sets a timeout to complete exchange prepareBlockCleanup(exchange); return status; }
Example #19
Source File: CropRotation.java From SI with BSD 2-Clause "Simplified" License | 5 votes |
@Override public Exchange findPrevious(KeyMID key, Exchange exchange) { int f = first; int s = second; Exchange prev = maps[f].putIfAbsent(key, exchange); if (prev != null || f==s) return prev; prev = maps[s].putIfAbsent(key, exchange); return prev; }
Example #20
Source File: BasicRto.java From SI with BSD 2-Clause "Simplified" License | 5 votes |
@Override public void processRTTmeasurement(long measuredRTT, Exchange exchange, int retransmissionCount){ //System.out.println("Measured an RTT of " + measuredRTT + " after using " + retransmissionCount + " retries." ); RemoteEndpoint endpoint = getRemoteEndpoint(exchange); int rtoType = endpoint.getExchangeEstimatorState(exchange); // The basic rto algorithm does not care for the blind estimator, set weak/strong to false endpoint.setBlindStrong(false); endpoint.setBlindWeak(false); //Perform normal update of the RTO updateEstimator(measuredRTT, rtoType, endpoint); }
Example #21
Source File: CoapStack.java From SI with BSD 2-Clause "Simplified" License | 5 votes |
@Override public void receiveResponse(Exchange exchange, Response response) { if (!response.getOptions().hasObserve()) exchange.setComplete(); if (deliverer != null) { deliverer.deliverResponse(exchange, response); // notify request that response has arrived } else { LOGGER.severe("Top of CoAP stack has no deliverer to deliver response"); } }
Example #22
Source File: Cocoa.java From SI with BSD 2-Clause "Simplified" License | 5 votes |
@Override public void processRTTmeasurement(long measuredRTT, Exchange exchange, int retransmissionCount) { //System.out.println("Measured an RTT of " + measuredRTT + " after using " + retransmissionCount + " retries." ); RemoteEndpoint endpoint = getRemoteEndpoint(exchange); int rtoType = endpoint.getExchangeEstimatorState(exchange); if(rtoType == NOESTIMATOR) return; endpoint.matchCurrentRTO(); //System.out.println("Measured RTT:" + measuredRTT); // System.out.println("Endpoint status: blindweak/blindstrong/state : " + endpoint.isBlindWeak() + "/" + endpoint.isBlindStrong() + "/" + endpoint.getExchangeEstimatorState(exchange)); if (endpoint.isBlindWeak() && rtoType == WEAKRTOTYPE) { // Received a weak RTT for the first time, apply weak RTO update endpoint.setBlindWeak(false); initializeRTOEstimators(measuredRTT, WEAKRTOTYPE, endpoint); } else if (endpoint.isBlindStrong() && rtoType == STRONGRTOTYPE) { // Received a strong RTT measurement for the first time, apply strong RTO update endpoint.setBlindStrong(false); initializeRTOEstimators(measuredRTT, STRONGRTOTYPE, endpoint); } else { // Perform normal update of the RTO updateEstimator(measuredRTT, rtoType, endpoint); } }
Example #23
Source File: ObserveLayer.java From SI with BSD 2-Clause "Simplified" License | 5 votes |
@Override public void receiveResponse(Exchange exchange, Response response) { if (response.getOptions().hasObserve() && exchange.getRequest().isCanceled()) { // The request was canceled and we no longer want notifications LOGGER.finer("Rejecting notification for canceled Exchange"); EmptyMessage rst = EmptyMessage.newRST(response); sendEmptyMessage(exchange, rst); // Matcher sets exchange as complete when RST is sent } else { // No observe option in response => always deliver super.receiveResponse(exchange, response); } }
Example #24
Source File: ObserveLayer.java From SI with BSD 2-Clause "Simplified" License | 5 votes |
@Override public void receiveEmptyMessage(Exchange exchange, EmptyMessage message) { // NOTE: We could also move this into the MessageObserverAdapter from // sendResponse into the method rejected(). if (message.getType() == Type.RST && exchange.getOrigin() == Origin.REMOTE) { // The response has been rejected ObserveRelation relation = exchange.getRelation(); if (relation != null) { relation.cancel(); } // else there was no observe relation ship and this layer ignores the rst } super.receiveEmptyMessage(exchange, message); }
Example #25
Source File: ObserveLayer.java From SI with BSD 2-Clause "Simplified" License | 5 votes |
@Override public void receiveEmptyMessage(Exchange exchange, EmptyMessage message) { // NOTE: We could also move this into the MessageObserverAdapter from // sendResponse into the method rejected(). if (message.getType() == Type.RST && exchange.getOrigin() == Origin.REMOTE) { // The response has been rejected ObserveRelation relation = exchange.getRelation(); if (relation != null) { relation.cancel(); } // else there was no observe relation ship and this layer ignores the rst } super.receiveEmptyMessage(exchange, message); }
Example #26
Source File: CongestionControlLayer.java From SI with BSD 2-Clause "Simplified" License | 5 votes |
private boolean checkNSTART(Exchange exchange) { getRemoteEndpoint(exchange).checkForDeletedExchanges(); if (getRemoteEndpoint(exchange).getNumberOfOngoingExchanges(exchange) < config .getInt("NSTART")) { // System.out.println("Processing exchange (NSTART OK!)"); // NSTART allows to start the exchange, proceed normally getRemoteEndpoint(exchange).registerExchange(exchange, calculateVBF(getRemoteEndpoint(exchange).getRTO())); // The exchange needs to be deleted after at least 255 s TODO: // should this value be calculated dynamically executor.schedule(new SweepCheckTask(getRemoteEndpoint(exchange), exchange), MAX_REMOTE_TRANSACTION_DURATION, TimeUnit.MILLISECONDS); return true; } else { // NSTART does not allow any further parallel exchanges towards the // remote endpoint // System.out.println("Nstart does not allow further exchanges with " // + getRemoteEndpoint(exchange).getRemoteAddress().toString()); // Check if the queue limit for exchanges is already reached if (getRemoteEndpoint(exchange).getConfirmableQueue().size() == EXCHANGELIMIT) { // Request cannot be queued TODO: does this trigger some // feedback for other layers? // System.out.println("Confirmable exchange queue limit reached! Message dropped..."); } else { // Queue exchange in the CON-Queue getRemoteEndpoint(exchange).getConfirmableQueue().add(exchange); // System.out.println("Added exchange to the queue (NSTART limit reached)"); } } return false; }
Example #27
Source File: CongestionControlLayer.java From SI with BSD 2-Clause "Simplified" License | 5 votes |
/** * The following method overrides the method provided by the reliability layer to include the advanced RTO calculation values * when determining the RTO. */ @Override protected void prepareRetransmission(Exchange exchange, RetransmissionTask task) { int timeout; //System.out.println("TXCount: " + exchange.getFailedTransmissionCount()); if (exchange.getFailedTransmissionCount() == 0) { timeout = (int)getRemoteEndpoint(exchange).getRTO(); if(appliesDithering()){ //TODO: Workaround to force CoCoA (-Strong) not to use the same RTO after backing off several times //System.out.println("Applying dithering, matching RTO"); getRemoteEndpoint(exchange).matchCurrentRTO(); timeout = (int)getRemoteEndpoint(exchange).getRTO(); // Apply dithering by randomly choosing RTO from [RTO, RTO * 1.5] float ack_random_factor = config.getFloat(NetworkConfig.Keys.ACK_RANDOM_FACTOR); timeout = getRandomTimeout(timeout, (int) (timeout*ack_random_factor)); } //System.out.println("meanrto:" + timeout + ";" + System.currentTimeMillis()); } else { int tempTimeout= (int)(getRemoteEndpoint(exchange).getExchangeVBF(exchange) * exchange.getCurrentTimeout()); timeout = (tempTimeout < MAX_RTO) ? tempTimeout : MAX_RTO; getRemoteEndpoint(exchange).setCurrentRTO(timeout); //System.out.println("RTX"); } exchange.setCurrentTimeout(timeout); //expectedmaxduration = calculateMaxTransactionDuration(exchange); //FIXME what was this for? //System.out.println("Sending MSG (timeout;timestamp:" + timeout + ";" + System.currentTimeMillis() + ")"); ScheduledFuture<?> f = executor.schedule(task , timeout, TimeUnit.MILLISECONDS); exchange.setRetransmissionHandle(f); }
Example #28
Source File: CongestionControlLayer.java From SI with BSD 2-Clause "Simplified" License | 5 votes |
/** * The following method overrides the method provided by the reliability layer to include the advanced RTO calculation values * when determining the RTO. */ @Override protected void prepareRetransmission(Exchange exchange, RetransmissionTask task) { int timeout; //System.out.println("TXCount: " + exchange.getFailedTransmissionCount()); if (exchange.getFailedTransmissionCount() == 0) { timeout = (int)getRemoteEndpoint(exchange).getRTO(); if(appliesDithering()){ //TODO: Workaround to force CoCoA (-Strong) not to use the same RTO after backing off several times //System.out.println("Applying dithering, matching RTO"); getRemoteEndpoint(exchange).matchCurrentRTO(); timeout = (int)getRemoteEndpoint(exchange).getRTO(); // Apply dithering by randomly choosing RTO from [RTO, RTO * 1.5] float ack_random_factor = config.getFloat(NetworkConfig.Keys.ACK_RANDOM_FACTOR); timeout = getRandomTimeout(timeout, (int) (timeout*ack_random_factor)); } //System.out.println("meanrto:" + timeout + ";" + System.currentTimeMillis()); } else { int tempTimeout= (int)(getRemoteEndpoint(exchange).getExchangeVBF(exchange) * exchange.getCurrentTimeout()); timeout = (tempTimeout < MAX_RTO) ? tempTimeout : MAX_RTO; getRemoteEndpoint(exchange).setCurrentRTO(timeout); //System.out.println("RTX"); } exchange.setCurrentTimeout(timeout); //expectedmaxduration = calculateMaxTransactionDuration(exchange); //FIXME what was this for? //System.out.println("Sending MSG (timeout;timestamp:" + timeout + ";" + System.currentTimeMillis() + ")"); ScheduledFuture<?> f = executor.schedule(task , timeout, TimeUnit.MILLISECONDS); exchange.setRetransmissionHandle(f); }
Example #29
Source File: CongestionControlLayer.java From SI with BSD 2-Clause "Simplified" License | 5 votes |
@Override public void receiveResponse(Exchange exchange, Response response) { //August: change the state of the remote endpoint (STRONG/WEAK/NOESTIMATOR) if failedTransmissionCount = 0; if (exchange.getFailedTransmissionCount() != 0) { getRemoteEndpoint(exchange).setEstimatorState(exchange); } super.receiveResponse(exchange, response); calculateRTT(exchange); checkRemoteEndpointQueue(exchange); }
Example #30
Source File: CongestionControlLayer.java From SI with BSD 2-Clause "Simplified" License | 5 votes |
/** * If we receive an ACK or RST, calculate the RTT and update the RTO values */ @Override public void receiveEmptyMessage(Exchange exchange, EmptyMessage message) { // If retransmissions were used, update the estimator state (WEAK / NO) if (exchange.getFailedTransmissionCount() != 0) { getRemoteEndpoint(exchange).setEstimatorState(exchange); } super.receiveEmptyMessage(exchange, message); calculateRTT(exchange); checkRemoteEndpointQueue(exchange); }