---
title: "abort(with:)"
framework: iousbhost
role: symbol
role_heading: Instance Method
path: "iousbhost/iousbhoststream/abort(with:)"
---

# abort(with:)

Aborts pending input/output requests.

## Declaration

```swift
func abort(with option: IOUSBHostAbortOption) throws
```

## Parameters

- `option`: A set of options. doc://com.apple.iousbhost/documentation/IOUSBHost/IOUSBHostAbortOption/synchronous is the default.

## Discussion

Discussion Set the stream context as nonactive on the device with an out-of-band (class-defined) mechanism before calling this method, in accordance with USB 3.2, 8.12.1.4. The device won’t select a nonactive stream to become the current stream on the endpoint.

## Topics

### Options

- [IOUSBHostAbortOption](iousbhost/iousbhostabortoption.md)

## See Also

### Sending I/O

- [IOUSBHostCompletionHandler](iousbhost/iousbhostcompletionhandler.md)
- [enqueueIORequest(with:completionHandler:)](iousbhost/iousbhoststream/enqueueiorequest(with:completionhandler:).md)
- [abort()](iousbhost/iousbhoststream/abort().md)
