Language

PublishConfig.Builder.SetTtlSec(Int32) Method

Definition

Sets the time interval (in seconds) an unsolicited ( PublishConfig.Builder.setPublishType(int)) publish session will be alive - broadcasting a packet.

[Android.Runtime.Register("setTtlSec", "(I)Landroid/net/wifi/aware/PublishConfig$Builder;", "", ApiSince=26)]
public Android.Net.Wifi.Aware.PublishConfig.Builder? SetTtlSec(int ttlSec);
[<Android.Runtime.Register("setTtlSec", "(I)Landroid/net/wifi/aware/PublishConfig$Builder;", "", ApiSince=26)>]
member this.SetTtlSec : int -> Android.Net.Wifi.Aware.PublishConfig.Builder

Parameters

ttlSec
Int32

Lifetime of a publish session in seconds.

Returns

The builder to facilitate chaining builder.setXXX(..).setXXX(..).

Attributes

Remarks

Sets the time interval (in seconds) an unsolicited ( PublishConfig.Builder.setPublishType(int)) publish session will be alive - broadcasting a packet. When the TTL is reached an event will be generated for DiscoverySessionCallback.onSessionTerminated() [unless setTerminateNotificationEnabled(boolean) disables the callback].

Optional. 0 by default - indicating the session doesn't terminate on its own. Session will be terminated when DiscoverySession.close() is called.

Android reference for android.net.wifi.aware.PublishConfig.Builder.setTtlSec.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to