// 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());