// TODO handle sending errors back to handshake engine. Callback?
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();
            }
        });
    }
@Override
public void failed(Throwable exc, ConnectionManager attachment) {
// TODO handle sending errors back to handshake engine. Callback?
connectionManager.close();
}
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) {
// TODO handle sending errors back to handshake engine. Callback?
connectionManager.close();
}
});
}