if (!sending) checkInboundFlight();
void sendMessage(short msg_type, byte[] body) throws IOException { TlsUtils.checkUint24(body.length); if (!sending) { checkInboundFlight(); sending = true; outboundFlight.removeAllElements(); } Message message = new Message(message_seq++, msg_type, body); outboundFlight.addElement(message); writeMessage(message); updateHandshakeMessagesDigest(message); }
void sendMessage(short msg_type, byte[] body) throws IOException { TlsUtils.checkUint24(body.length); if (!sending) { checkInboundFlight(); sending = true; outboundFlight.removeAllElements(); } Message message = new Message(message_seq++, msg_type, body); outboundFlight.addElement(message); writeMessage(message); updateHandshakeMessagesDigest(message); }
void finish() { DTLSHandshakeRetransmit retransmit = null; if (!sending) { checkInboundFlight(); } else { prepareInboundFlight(null); if (previousInboundFlight != null) { /* * RFC 6347 4.2.4. In addition, for at least twice the default MSL defined for [TCP], * when in the FINISHED state, the node that transmits the last flight (the server in an * ordinary handshake or the client in a resumed handshake) MUST respond to a retransmit * of the peer's last flight with a retransmit of the last flight. */ retransmit = new DTLSHandshakeRetransmit() { public void receivedHandshakeRecord(int epoch, byte[] buf, int off, int len) throws IOException { processRecord(0, epoch, buf, off, len); } }; } } recordLayer.handshakeSuccessful(retransmit); }