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

# publish()

Attempts to advertise the receiver’s on the network.

## Declaration

```swift
func publish()
```

## Discussion

Discussion This method returns immediately, with success or failure indicated by the callbacks to the delegate. This is equivalent to calling publish(options:) with the default options (0).

## See Also

### Using Network Services

- [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)
- [stop()](foundation/netservice/stop().md)
- [stopMonitoring()](foundation/netservice/stopmonitoring().md)
