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

# nw_framer_create_definition(_:_:_:)

Initializes a new protocol definition based on your protocol implementation.

## Declaration

```swift
func nw_framer_create_definition(_ identifier: UnsafePointer<CChar>, _ flags: UInt32, _ start_handler: @escaping nw_framer_start_handler_t) -> nw_protocol_definition_t
```

## Discussion

Discussion Each time you initialize a protocol definition with your custom start handler, a new definition is created that will not be considered equal to other definitions. If you need to associate messages with a protocol you have added to a connection’s protocol stack, make sure to use the same definition.

## See Also

### Adding Framers to Connections

- [nw_framer_start_handler_t](network/nw_framer_start_handler_t.md)
- [nw_framer_t](network/nw_framer_t.md)
- [nw_framer_start_result_t](network/nw_framer_start_result_t.md)
- [NW_FRAMER_CREATE_FLAGS_DEFAULT](network/nw_framer_create_flags_default.md)
- [nw_framer_create_options(_:)](network/nw_framer_create_options(_:).md)
