The Network framwork is an advanced alterantive to Sockets as made avaialble under System.Net.Sockets which is suitable for use in mobile application with demanding network capabilities. The framework is designed to solve these problems:
- Establishing a connection over different transports, automatically handling hostnames that have both IPV4 and IPV6 addresses, supporting Bonjour connections and Proxy Automatic Configuration (PAC)
- A callback based approach for performing non-blocking IO.
- Easily support for encryption and authentication over your network connections using TLS.
- Being mobile friendly, coping with turning on the cellular radio on demand, supporting multi-path connections that can move from one network interface to another and providing a built-in reconnection and connection monitoring service.
The Network framework also features a modern architecture that makes it faster than the traditional socket API on Apple platforms.
To create an outgoing network connection, use the NWConnection class.
To accept incoming network connections, use the NWListener class.
|NWConnection||Represents a bidirectional network connection.|
|NWConnectionReceiveCompletion||Signature for receiving data from NWConnection’s NWConnection.Receive or NWConnection.ReceiveMessage method.|
|NWConnectionReceiveDispatchDataCompletion||Signature for receiving data from NWConnection’s NWConnection.ReceiveData or NWConnection.ReceiveMessageData method.|
|NWConnectionState||Describes the state of the network connection, provided to your state changed handler in your NWConnection.|
|NWEndpoint||Endpoints represent a remote resource either a specific host and port or a service exposed via Bonjour (a zero-configuration network service discovery system)|
|NWEndpointType||Supported endpoint types for a network connection.|
|NWError||Used to describe networking errors on established connections.|
|NWInterfaceType||Describes the possible networking interface types.|
|NWIPEcnFlag||Flags set on IP packets for Explicit Congestion Notification|
|NWIPVersion||Desired IP Version for the Protocol Options|
|NWListenerState||Enumerates the states of a NWListener object.|
|NWMultiPathService||The possible options on the NWParameters that control how to treat multi-path service.|
|NWParameters||Manages the parameters for a connection. Use one of the Create factory methods to create a configured instance of NWParameters.|
|NWParametersExpiredDnsBehavior||Enumerates possible behaviors after DNS expiration.|
|NWPath||Describes the networking path in use.|
|NWPathMonitor||Observes a NWPath and allows for monitoring and reacting to changes.|
|NWPathStatus||States for the network path, describing whether it is possible to send data over a path.|
|NWProtocolDefinition||A predefined network protocol that can be compared with others.|
|NWProtocolMetadata||Metadata for network protocols.|
|NWProtocolOptions||Contains a network protocol and its optional characteristics.|
|NWProtocolStack||Container for NWProtocolOptions objects.|
|NWServiceClass||Enumerates the supported classes of service.|