upradeToSslSocket method Null safety

Future<void> upradeToSslSocket()
inherited

Implementation

Future<void> upradeToSslSocket() async {
  _socketStreamSubscription.pause();
  final secureSocket = await SecureSocket.secure(_socket);
  log('now using secure connection.', initial: initialApp);
  await _socketStreamSubscription.cancel();
  isSocketClosingExpected = true;
  _socket.destroy();
  isSocketClosingExpected = false;
  connect(secureSocket);
}