---
title: NetworkConnection
framework: network
role: symbol
role_heading: Class
path: network/networkconnection
---

# NetworkConnection

Connect to an endpoint on the network to send and receive data.

## Declaration

```swift
final class NetworkConnection<ApplicationProtocol> where ApplicationProtocol : NetworkProtocolOptions
```

## Overview

Overview A connection handles establishment of any transport, security, and application-level protocols required to transmit and receive user data. Connections may make multiple establishment attempts before the connection is ready.

## Topics

### Initializers

- [init(to:using:)](network/networkconnection/init(to:using:)-182om.md)
- [init(to:using:)](network/networkconnection/init(to:using:)-51aq2.md)
- [init(to:using:)](network/networkconnection/init(to:using:)-5e864.md)
- [init(to:using:)](network/networkconnection/init(to:using:)-69glf.md)
- [init(to:using:)](network/networkconnection/init(to:using:)-6yzx9.md)
- [init(to:using:)](network/networkconnection/init(to:using:)-7gprx.md)
- [init(to:using:)](network/networkconnection/init(to:using:)-907m0.md)
- [init(to:using:)](network/networkconnection/init(to:using:)-9kq3t.md)

### Instance Properties

- [applicationError](network/networkconnection/applicationerror.md)
- [currentPath](network/networkconnection/currentpath.md)
- [datagrams](network/networkconnection/datagrams.md)
- [keepalive](network/networkconnection/keepalive.md)
- [localEndpoint](network/networkconnection/localendpoint.md)
- [negotiatedALPN](network/networkconnection/negotiatedalpn.md)
- [remoteEndpoint](network/networkconnection/remoteendpoint.md)
- [remoteIdleTimeout](network/networkconnection/remoteidletimeout.md)
- [remoteMaxStreamsBidirectional](network/networkconnection/remotemaxstreamsbidirectional.md)
- [remoteMaxStreamsUnidirectional](network/networkconnection/remotemaxstreamsunidirectional.md)
- [securityProtocolMetadata](network/networkconnection/securityprotocolmetadata.md)
- [usableDatagramFrameSize](network/networkconnection/usabledatagramframesize.md)
- [wifiAware](network/networkconnection/wifiaware.md)

### Instance Methods

- [inboundStreams(_:)](network/networkconnection/inboundstreams(_:).md)
- [inboundStreams(prepending:_:)](network/networkconnection/inboundstreams(prepending:_:).md)
- [onBetterPathUpdate(_:)](network/networkconnection/onbetterpathupdate(_:)-2h2wu.md)
- [onBetterPathUpdate(_:)](network/networkconnection/onbetterpathupdate(_:)-7b4ue.md)
- [onPathUpdate(_:)](network/networkconnection/onpathupdate(_:)-2uoc8.md)
- [onPathUpdate(_:)](network/networkconnection/onpathupdate(_:)-6sn1s.md)
- [onStateUpdate(_:)](network/networkconnection/onstateupdate(_:).md)
- [onViabilityUpdate(_:)](network/networkconnection/onviabilityupdate(_:)-13jwf.md)
- [onViabilityUpdate(_:)](network/networkconnection/onviabilityupdate(_:)-70awf.md)
- [openStream(directionality:)](network/networkconnection/openstream(directionality:).md)
- [openStream(directionality:_:)](network/networkconnection/openstream(directionality:_:).md)
- [start()](network/networkconnection/start().md)
- [tryNextEndpoint()](network/networkconnection/trynextendpoint().md)

## Relationships

### Inherits From

- [NetworkChannel](network/networkchannel.md)

### Conforms To

- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [Identifiable](swift/identifiable.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)
