---
title: Close
framework: usbdriverkit
role: symbol
role_heading: Instance Method
path: usbdriverkit/iousbhostdevice/close
---

# Close

Closes the session to the host device.

## Declaration

```occ
virtual kern_return_t Close(IOService *forClient, IOOptionBits options);
```

## Parameters

- `forClient`: The service object that is closing the session.
- `options`: Options to use when closing the service. Specify 0 for this parameter.

## Return Value

Return Value kIOReturnSuccess on success, or another value if an error occurs. See Error Codes.

## Discussion

Discussion This method closes a session to a device that you previously opened using the Open method. The method acquires the service’s workloop lock, and aborts any I/O initiated by the client service. This method may call commandSleep to allow for the processing of aborted I/O before returning.

## See Also

### Managing the Device Session

- [Open](usbdriverkit/iousbhostdevice/open.md)
- [Reset](usbdriverkit/iousbhostdevice/reset.md)
