public void sendAlertRecord(AlertFragment alertFragment) {
        TlsPlaintextRecord record = new TlsPlaintextRecord(TlsConstants.ALERT, version);
        record.setFragment(alertFragment);
        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) {
                // TODO handle sending errors back to handshake engine. Callback?
                connectionManager.close();
            }
        });
    }
public void sendAlertRecord(AlertFragment alertFragment) {
        TlsPlaintextRecord record = new TlsPlaintextRecord(TlsConstants.ALERT, version);
        record.setFragment(alertFragment);
        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 sendalertrecord(alertfragment alertfragment) { tlsplaintextrecord record = new tlsplaintextrecord(tlsconstants.alert, version); record.setfragment(alertfragment); 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(); } }); }