Framework

Network

Create network connections to send and receive data using transport and security protocols.

Overview

Use this framework when you need direct access to protocols like TLS, TCP, and UDP for your custom application protocols. Continue to use URLSession, which is built upon this framework, for loading HTTP- and URL-based resources.

Topics

Essentials

enum NWEndpoint

A local or remote endpoint in a network connection.

class NWParameters

An object that stores the protocols to use for connections, options for sending data, and network path constraints.

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.

class NWEthernetChannel

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

Network Protocols

Configure protocol options to use with connections and listeners, and inspect the results of protocol handshakes.

Building a Custom Peer-to-Peer Protocol

Use Bonjour and TLS to establish secure connections between devices, and define a protocol for sending messages to play a simple game of Tic-Tac-Toe.

class NWProtocolTCP

A network protocol for connections that use the Transmission Control Protocol.

class NWProtocolTLS

A network protocol for connections that use Transport Layer Security.

class NWProtocolUDP

A network protocol for connections that use the User Datagram Protocol.

class NWProtocolIP

A network protocol for configuring the Internet Protocol on connections.

class NWProtocolWebSocket

A network protocol for connections that use WebSocket.

class NWProtocolFramer

A customizable network protocol for defining application message parsers.

Network Security

Security Options

Configure security options for TLS handshakes.

Paths and Interfaces

struct NWPath

An object that contains information about the properties of the network that a connection uses, or that are available to your app.

class NWPathMonitor

An observer that you use to monitor and react to network changes.

struct NWInterface

An interface that a network connection uses to send and receive data.

Errors

enum NWError

The errors returned by objects in the Network framework.

Network Debugging

Choosing a Network Debugging Tool

Decide which tool works best for your network debugging problem.

Debugging HTTP Server-Side Errors

Understand HTTP server-side errors and how to debug them.

Debugging HTTPS Problems with CFNetwork Diagnostic Logging

Use CFNetwork diagnostic logging to investigate HTTP and HTTPS problems.

Recording a Packet Trace

Learn how to record a low-level trace of network traffic.

Taking Advantage of Third-Party Network Debugging Tools

Learn about the available third-party network debugging tools.

C-Language Symbols

Access Network framework symbols used in C.

Reference

Network Constants

Access Network framework constants used in C.

Network Functions

Access Network framework functions used in C.

Network Type Aliases

Access Network framework types used in C.