Class

NWEthernetChannel

An object you use to send and receive custom Ethernet frames.

Declaration

final class NWEthernetChannel

Overview

Use Ethernet channels to send and receive custom Ethernet frame types over an interface.

Creating Ethernet channels requires the com.apple.developer.networking.custom-protocol entitlement.

Topics

Managing Ethernet Channels

init(on: NWInterface, etherType: UInt16)

Initializes an Ethernet channel on a specific interface with a custom Ethernet type.

func start(queue: DispatchQueue)

Starts the process of registering the channel, and sets the queue on which all channel events are delivered.

func cancel()

Unregisters the channel from the interface.

Handling State Updates

var state: NWEthernetChannel.State

The current state of the channel.

enum NWEthernetChannel.State

States indicating whether an Ethernet channel is able to send and receive frames.

var stateUpdateHandler: ((NWEthernetChannel.State) -> Void)?

A handler that delivers channel state updates.

Sending and Receiving Ethernet Frames

Inspecting Ethernet Channels

let etherType: UInt16

The custom Ethernet type with which the channel was initialized.

let interface: NWInterface

The interface with which the channel was initialized.

var queue: DispatchQueue?

The queue on which channel events will be delivered.

var debugDescription: String

The description of the Ethernet channel.

Relationships

See Also

Connections and Listeners

class NWConnection

A bidirectional data connection between a local endpoint and a remote endpoint.

class NWListener

An object you use to listen for incoming network connections.

class NWBrowser

An object you use to browse for available network services.

Beta

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software