public void sendHandshakeRecord(TlsHandshakeMessage handshakeMessage) {
        TlsPlaintextRecord record = new TlsPlaintextRecord(TlsConstants.HANDSHAKE, version);
        TlsHandshakeFragment fragment = new HandshakeFragment(handshakeMessage);
        record.setFragment(fragment);
        byte[] encoded = record.encode();
        ByteBuffer buffer = ByteBuffer.wrap(encoded);
        connectionManager.write(buffer, new CompletionHandler<Integer, ConnectionManager>() {
            @Override
            public void completed(Integer result, ConnectionManager attachment) {
                // Nothing to do here
            }
            @Override
            public void failed(Throwable exc, ConnectionManager attachment) {
                // TODO handle sending errors back to handshake engine. Callback?
                connectionManager.close();
            }
        });
    }
public void sendHandshakeRecord(TlsHandshakeMessage handshakeMessage) {
        TlsPlaintextRecord record = new TlsPlaintextRecord(TlsConstants.HANDSHAKE, version);
        TlsHandshakeFragment fragment = new HandshakeFragment(handshakeMessage);
        record.setFragment(fragment);
        byte[] encoded = record.encode();
        ByteBuffer buffer = ByteBuffer.wrap(encoded);
        connectionManager.write(buffer, new CompletionHandler<Integer, ConnectionManager>() {
            @Override
            public void completed(Integer result, ConnectionManager attachment) {
               
            }
            @Override
            public void failed(Throwable exc, ConnectionManager attachment) {
               
                connectionManager.close();
            }
        });
    }
public void sendhandshakerecord(tlshandshakemessage handshakemessage) { tlsplaintextrecord record = new tlsplaintextrecord(tlsconstants.handshake, version); tlshandshakefragment fragment = new handshakefragment(handshakemessage); record.setfragment(fragment); byte[] encoded = record.encode(); bytebuffer buffer = bytebuffer.wrap(encoded); connectionmanager.write(buffer, new completionhandler<integer, connectionmanager>() { @override public void completed(integer result, connectionmanager attachment) { } @override public void failed(throwable exc, connectionmanager attachment) { connectionmanager.close(); } }); }