close method

Future<void> close()

Implementation

Future<void> close() async {
  await shutdown();
  if (!_socketClosed) {
    final socket = _socket;
    if (socket != null) {
      socket.closeSync();
    }
    _socketClosed = true;
  }
  final ssl = _ssl;
  if (ssl != null && ssl != ffi.nullptr) {
    _openSsl.SSL_free(ssl);
    _ssl = null;
    _networkReadBio = null;
    _networkWriteBio = null;
  }
  final ctx = _ctx;
  if (ctx != null && ctx != ffi.nullptr) {
    _openSsl.SSL_CTX_free(ctx);
    _ctx = null;
  }
}