/** * Gets the session containing the connection's <em>current</em> state. * * <p>This is the {@link #establishedSession} if not <code>null</code> or the session negotiated * in the {@link #ongoingHandshake}. * * @return the <em>current</em> session or <code>null</code> if neither an established session nor * an ongoing handshake exists */ public DTLSSession getSession() { if (establishedSession != null) { return establishedSession; } else if (ongoingHandshake != null) { return ongoingHandshake.getSession(); } else { return null; } }
@Override public void handshakeStarted(Handshaker handshaker) throws HandshakeException { this.ongoingHandshake = handshaker; LOGGER.log(Level.FINE, "Handshake with [{0}] has been started", handshaker.getPeerAddress()); }