@override Future<void> close() async { if (socket == null) { throw WCException("Connection already closed"); } await socket!.sink.close(); _onClose(); }