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

# publish(options:)

Attempts to advertise the receiver on the network, with the given options.

## Declaration

```swift
func publish(options: NetService.Options = [])
```

## Parameters

- `options`: Options for the receiver. The supported options are described in doc://com.apple.foundation/documentation/Foundation/NetService/Options.

## Discussion

Discussion This method returns immediately, with success or failure indicated by the callbacks to the delegate.

## See Also

### Using Network Services

- [publish()](foundation/netservice/publish().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)
