---
title: "urlSession(_:streamTask:didBecome:outputStream:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/urlsessionstreamdelegate/urlsession(_:streamtask:didbecome:outputstream:)"
---

# urlSession(_:streamTask:didBecome:outputStream:)

Tells the delegate that the stream task has been completed as a result of the stream task calling the captureStreams() method.

## Declaration

```swift
optional func urlSession(_ session: URLSession, streamTask: URLSessionStreamTask, didBecome inputStream: InputStream, outputStream: OutputStream)
```

## Parameters

- `session`: The session of the stream task that has been completed.
- `streamTask`: The stream task that has been completed.
- `inputStream`: The created input stream. This doc://com.apple.foundation/documentation/Foundation/InputStream object is unopened.
- `outputStream`: The created output stream. This doc://com.apple.foundation/documentation/Foundation/OutputStream object is unopened

## Discussion

Discussion This delegate method will only be called after all enqueued reads and writes for the stream task have been completed.
