Package ch.ethz.inf.vs.scandium.dtls

Examples of ch.ethz.inf.vs.scandium.dtls.DTLSFlight.addMessage()


   
    if (session != null) {
      DTLSMessage closeNotify = new AlertMessage(AlertLevel.WARNING, AlertDescription.CLOSE_NOTIFY);
     
      DTLSFlight flight = new DTLSFlight();
      flight.addMessage(new Record(ContentType.ALERT, session.getWriteEpoch(), session.getSequenceNumber(), closeNotify, session));
      flight.setRetransmissionNeeded(false);
     
      cancelPreviousFlight(peerAddress);
 
      flight.setPeerAddress(peerAddress);
View Full Code Here


           
            // server must reply with CLOSE_NOTIFY
            if (!session.isClient()) {
              DTLSMessage closeNotify = new AlertMessage(AlertLevel.WARNING, AlertDescription.CLOSE_NOTIFY);
              flight = new DTLSFlight();
              flight.addMessage(new Record(ContentType.ALERT, session.getWriteEpoch(), session.getSequenceNumber(), closeNotify, session));
              flight.setRetransmissionNeeded(false);
            }
           
            if (dtlsSessions.remove(addressToKey(peerAddress))!=null) {
              LOGGER.info("Closed session with peer: " + peerAddress.toString());
View Full Code Here

        // if the first received message failed, no session has been set
        session = new DTLSSession(peerAddress, false);
      }
      cancelPreviousFlight(peerAddress);
     
      flight.addMessage(new Record(ContentType.ALERT, session.getWriteEpoch(), session.getSequenceNumber(), alert, session));
      sendFlight(flight);
    } // receive()
    return null;
  }
View Full Code Here

      scheduleRetransmission(flight);
    }
   
    // the CoAP message has been encrypted and can be sent to the peer
    if (encryptedMessage != null) {
      flight.addMessage(encryptedMessage);
    }
   
    flight.setPeerAddress(peerAddress);
    flight.setSession(session);
    sendFlight(flight);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.