Instance Property

state

The status of the connection

Declaration

var state: NWTCPConnectionState { get }

Discussion

Use Key-Value Observing (KVO) to monitor the state. Many methods, such as reading and writing on the connection, are only valid when the state is NWTCPConnectionStateConnected. For information about KVO, see Key-Value Observing Programming Guide.

See Also

Monitoring the Connection Status

enum NWTCPConnectionState

Defined connection states. New types may be defined in the future.

var isViable: Bool

The viability of a TCP connection indicates whether or not data can be transferred

var error: Error?

The connection-wide error property

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