<!--
{
  "availability" : [
    "macOS: 13.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Virtualization",
  "identifier" : "/documentation/Virtualization/VZVirtioConsoleDeviceDelegate/consoleDevice(_:didClose:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Virtualization"
    ],
    "preciseIdentifier" : "c:objc(pl)VZVirtioConsoleDeviceDelegate(im)consoleDevice:didClosePort:"
  },
  "title" : "consoleDevice(_:didClose:)"
}
-->

# consoleDevice(_:didClose:)

Tells the delegate that the framework closed a console port.

```
optional func consoleDevice(_ consoleDevice: VZVirtioConsoleDevice, didClose consolePort: VZVirtioConsolePort)
```

## Parameters

`consoleDevice`

The console port’s console device.

`consolePort`

The [`VZVirtioConsolePort`](/documentation/Virtualization/VZVirtioConsolePort) port that the framework closed.

## Discussion

Be sure to finish processing or flushing any remaining data from the [`VZVirtioConsolePort`](/documentation/Virtualization/VZVirtioConsolePort) attachment after closing a port, or the additional data might remain on the serial port.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)