Instance Property


The status of the connection


var state: NWTCPConnectionState { get }


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