createNetService

actual fun createNetService(type: String, name: String, port: Int, priority: Int, weight: Int, addresses: List<String>?, txt: Map<String, String>): NetService

Create a new DNS-SD to publish on the network. Make sure to call this on the main thread.

Return

the platform instance of the service to register or unregister

Parameters

type

the service type (e.g. _example._tcp)

name

the name of the service to publish

port

the port of the provided service

priority

the priority of the created DNS entry

weight

the weight of the created DNS entry relative to priority

addresses

the address to advertise (if null, let the platform decide)

txt

optional attributes to publish

See also

actual fun createNetService(type: String, name: String, port: Int, priority: Int, weight: Int, addresses: List<String>?, txt: Map<String, String>): NetService

Create a new DNS-SD to publish on the network. Make sure to call this on the main thread.

Return

the platform instance of the service to register or unregister

Parameters

type

the service type (e.g. _example._tcp)

name

the name of the service to publish

port

the port of the provided service

priority

the priority of the created DNS entry

weight

the weight of the created DNS entry relative to priority

addresses

the address to advertise (if null, let the platform decide)

txt

optional attributes to publish

See also

expect fun createNetService(type: String, name: String, port: Int = 0, priority: Int = 0, weight: Int = 1, addresses: List<String>? = null, txt: Map<String, String> = emptyMap()): NetService

Create a new DNS-SD to publish on the network. Make sure to call this on the main thread.

Return

the platform instance of the service to register or unregister

Parameters

type

the service type (e.g. _example._tcp)

name

the name of the service to publish

port

the port of the provided service

priority

the priority of the created DNS entry

weight

the weight of the created DNS entry relative to priority

addresses

the address to advertise (if null, let the platform decide)

txt

optional attributes to publish

See also

actual fun createNetService(type: String, name: String, port: Int, priority: Int, weight: Int, addresses: List<String>?, txt: Map<String, String>): NetService

Create a new DNS-SD to publish on the network. Make sure to call this on the main thread.

Return

the platform instance of the service to register or unregister

Parameters

type

the service type (e.g. _example._tcp)

name

the name of the service to publish

port

the port of the provided service

priority

the priority of the created DNS entry

weight

the weight of the created DNS entry relative to priority

addresses

the address to advertise (if null, let the platform decide)

txt

optional attributes to publish

See also