shutdown method

Future<void> shutdown()

Implementation

Future<void> shutdown() async {
  if (_ssl == null || _ssl == ffi.nullptr || !_sslInitialized) {
    return;
  }
  final result = _openSsl.SSL_shutdown(_sslPtr);
  if (result == 0) {
    await _drainWriteBio();
    await _fillReadBio();
    _openSsl.SSL_shutdown(_sslPtr);
  }
  await _drainWriteBio();
  _sslInitialized = false;
}