---
title: newConnectionHandler
framework: network
role: symbol
role_heading: Instance Property
path: network/nwlistener/newconnectionhandler
---

# newConnectionHandler

A handler that receives inbound connections.

## Declaration

```swift
@preconcurrency final var newConnectionHandler: (@Sendable (NWConnection) -> Void)? { get set }
```

## Discussion

Discussion Upon receiving a new connection, you should set update handlers on the connection and start it in order to accept it. If you want to reject the connection, cancel the connection.

## See Also

### Receiving Connections

- [newConnectionLimit](network/nwlistener/newconnectionlimit.md)
- [InfiniteConnectionLimit](network/nwlistener/infiniteconnectionlimit.md)
