---
title: "consoleDevice(_:didClose:)"
framework: virtualization
role: symbol
role_heading: Instance Method
path: "virtualization/vzvirtioconsoledevicedelegate/consoledevice(_:didclose:)"
---

# consoleDevice(_:didClose:)

Tells the delegate that the framework closed a console port.

## Declaration

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

## Parameters

- `consoleDevice`: The console port’s console device.
- `consolePort`: The doc://com.apple.virtualization/documentation/Virtualization/VZVirtioConsolePort port that the framework closed.

## Discussion

Discussion Be sure to finish processing or flushing any remaining data from the VZVirtioConsolePort attachment after closing a port, or the additional data might remain on the serial port.

## See Also

### Responding to console device changes

- [consoleDevice(_:didOpen:)](virtualization/vzvirtioconsoledevicedelegate/consoledevice(_:didopen:).md)
