---
title: stop()
framework: foundation
role: symbol
role_heading: Instance Method
path: foundation/netservice/stop()
---

# stop()

Halts a currently running attempt to publish or resolve a service.

## Declaration

```swift
func stop()
```

## Discussion

Discussion The delegate will receive netServiceDidStop(_:) after the service stops. It is safe to remove all strong references to the service immediately after calling stop().

## See Also

### Using Network Services

- [publish()](foundation/netservice/publish().md)
- [publish(options:)](foundation/netservice/publish(options:).md)
- [resolve()](foundation/netservice/resolve().md)
- [resolve(withTimeout:)](foundation/netservice/resolve(withtimeout:).md)
- [port](foundation/netservice/port.md)
- [startMonitoring()](foundation/netservice/startmonitoring().md)
- [stopMonitoring()](foundation/netservice/stopmonitoring().md)
