<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.15.0 -",
    "tvOS: 13.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Network",
  "identifier" : "/documentation/Network/NWProtocolFramerImplementation/handleOutput(framer:message:messageLength:isComplete:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Network"
    ],
    "preciseIdentifier" : "s:7Network30NWProtocolFramerImplementationP12handleOutput6framer7message0H6Length10isCompleteyAA0bC0C8InstanceC_AJ7MessageCSiSbtF"
  },
  "title" : "handleOutput(framer:message:messageLength:isComplete:)"
}
-->

# handleOutput(framer:message:messageLength:isComplete:)

Notifies your protocol about a new outbound message.

```
func handleOutput(framer: NWProtocolFramer.Instance, message: NWProtocolFramer.Message, messageLength: Int, isComplete: Bool)
```

## Parameters

`framer`

The framer instance associated with the connection.

`message`

The framer message passed by the application.

`messageLength`

The length of the message content being sent.

`isComplete`

A boolean indicating if this the last chunk of a message.

## Discussion

The output handler is your opportunity to encapsulate or encode a signle application message. You should write any output using [`writeOutput(data:)`](/documentation/Network/NWProtocolFramer/Instance/writeOutput(data:)-ydvk) or [`writeOutputNoCopy(length:)`](/documentation/Network/NWProtocolFramer/Instance/writeOutputNoCopy(length:)) before returning from the output handler. If you do not write a message, the application message will be discarded.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)