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

# abort()

Aborts pending input/output requests synchronously.

## Declaration

```swift
func abort() throws
```

## 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.

## See Also

### Sending I/O

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