Network(一)框架概览

Network(一)框架概览


资源

– Apple Documentation : Network Framework

https://developer.apple.com/documentation/network?language=objc


SDKs 适用范围

  • iOS 12.0+
  • macOS 10.14+
  • Mac Catalyst 13.0+
  • tvOS 12.0+
  • watchOS 6.0+

Overview

这个框架用来创建网络连接,使用传输和加密协议 来发送和接收数据。

使用这个框架,你可以为你自定义的应用协议 直接访问 TLS, TCP, and UDP 协议。

NSURLSession 也是基于这个框架来实现加载 HTTP- 和基于URL的资源,


Topics

1、Essentials

nw_endpoint_t

A local or remote endpoint in a network connection.


nw_parameters_t

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

2、Connections and Listeners

Implementing netcat with Network Framework

Build a simple netcat tool that establishes network connections and transfers data.


nw_connection_t

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


nw_listener_t

An object you use to listen for incoming network connections.


nw_browser_t

An object you use to browse for available network services.


nw_ethernet_channel_t

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

3、Network Protocols

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


TCP Options

Configure options for connections that use the Transmission Control Protocol.


TLS Options

Configure options for connections that use Transport Layer Security.


UDP Options

Configure options for connections that use the User Datagram Protocol.


IP Options

Configure Internet Protocol options on connections.


WebSocket Options

Configure options for connections that use WebSocket.


Framer Protocol Options

Create custom protocols to frame applications messages over a connection.


4、Network Security

Security Options

Configure security options for TLS handshakes.


5、Paths and Interfaces


nw_path_t

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


nw_path_monitor_t

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


nw_interface_t

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


6、Memory Management

nw_release

Releases a reference count on a Network.framework object.


nw_retain

Adds a reference count to a Network.framework object.

nw_object_t

The generic type for objects in the Network framework.


7、Errors

nw_error_t

The errors returned by the Network framework.


8、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.


9、Protocols

OS_nw_advertise_descriptor

OS_nw_browse_descriptor

OS_nw_browse_result

OS_nw_browser

OS_nw_connection

OS_nw_content_context

OS_nw_data_transfer_report

OS_nw_endpoint

OS_nw_error

OS_nw_establishment_report

OS_nw_ethernet_channel

OS_nw_framer

OS_nw_interface

OS_nw_listener

OS_nw_object

OS_nw_parameters

OS_nw_path

OS_nw_path_monitor

OS_nw_protocol_definition

OS_nw_protocol_metadata

OS_nw_protocol_options

OS_nw_protocol_stack

OS_nw_txt_record

OS_nw_ws_request

OS_nw_ws_response


10、Reference

Network Enumerations

Network Constants

Access Network framework constants used in C.

Network Functions

Access Network framework functions used in C.

发布了14 篇原创文章 · 获赞 1 · 访问量 974

猜你喜欢

转载自blog.csdn.net/weixin_45390999/article/details/103178882
今日推荐