---
title: "nw_framer_set_stop_handler(_:_:)"
framework: network
role: symbol
role_heading: Function
path: "network/nw_framer_set_stop_handler(_:_:)"
---

# nw_framer_set_stop_handler(_:_:)

Sets a block to handle when the connection is being closed.

## Declaration

```swift
func nw_framer_set_stop_handler(_ framer: nw_framer_t, _ stop_handler: @escaping nw_framer_stop_handler_t)
```

## See Also

### Managing Instance Lifetime

- [nw_framer_mark_ready(_:)](network/nw_framer_mark_ready(_:).md)
- [nw_framer_mark_failed_with_error(_:_:)](network/nw_framer_mark_failed_with_error(_:_:).md)
- [nw_framer_prepend_application_protocol(_:_:)](network/nw_framer_prepend_application_protocol(_:_:).md)
- [nw_framer_stop_handler_t](network/nw_framer_stop_handler_t.md)
- [nw_framer_set_cleanup_handler(_:_:)](network/nw_framer_set_cleanup_handler(_:_:).md)
- [nw_framer_cleanup_handler_t](network/nw_framer_cleanup_handler_t.md)
