---
title: NetworkListener
framework: network
role: symbol
role_heading: Class
path: network/networklistener
---

# NetworkListener

Listen for incoming network connections.

## Declaration

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

## Overview

Overview A listener receives incoming connections by binding to a local endpoint. It accepts connections based on the protocols defined in its protocol stack. Accepted connections will represent new local and remote address and port tuples.

## Topics

### Initializers

- [init(for:using:)](network/networklistener/init(for:using:)-2hkg.md)
- [init(for:using:)](network/networklistener/init(for:using:)-2vh87.md)

### Instance Properties

- [newConnectionLimit](network/networklistener/newconnectionlimit.md)
- [port](network/networklistener/port.md)
- [service](network/networklistener/service.md)

### Instance Methods

- [newConnectionLimit(_:)](network/networklistener/newconnectionlimit(_:).md)
- [onServiceRegistrationUpdate(_:)](network/networklistener/onserviceregistrationupdate(_:).md)
- [onStateUpdate(_:)](network/networklistener/onstateupdate(_:).md)
- [run(_:)](network/networklistener/run(_:)-42k25.md)
- [run(_:)](network/networklistener/run(_:)-4iov3.md)

### Type Aliases

- [NetworkListener.ServiceRegistrationUpdateHandler](network/networklistener/serviceregistrationupdatehandler.md)
- [NetworkListener.StateUpdateHandler](network/networklistener/stateupdatehandler.md)

### Enumerations

- [NetworkListener.ServiceRegistrationChange](network/networklistener/serviceregistrationchange.md)
- [NetworkListener.State](network/networklistener/state.md)

## Relationships

### Conforms To

- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)
