語言

AwareDataPathRequest.Builder.SetTransportProtocol(Int32) 方法

定義

設定傳輸協定,用於在此連結建立連線。

[Android.Runtime.Register("setTransportProtocol", "(I)Landroid/net/wifi/aware/AwareDataPathRequest$Builder;", "", ApiSince=37)]
public Android.Net.Wifi.Aware.AwareDataPathRequest.Builder SetTransportProtocol(int transportProtocol);
[<Android.Runtime.Register("setTransportProtocol", "(I)Landroid/net/wifi/aware/AwareDataPathRequest$Builder;", "", ApiSince=37)>]
member this.SetTransportProtocol : int -> Android.Net.Wifi.Aware.AwareDataPathRequest.Builder

參數

transportProtocol
Int32

用於通訊的傳輸協定。 價值介於0到255之間(含)

傳回

目前的 Builder 建置器,使建構方法能夠串連起來。 這個值不可能為零值。

屬性

備註

設定傳輸協定,用於在此連結建立連線。 此設定應僅在伺服器裝置上進行,例如建立 TCP ServerSocket 的裝置。

注意:伺服器裝置必須是 Publisher 裝置!;傳輸協定資訊只能在安全連結上指定,並使用 setDataPathSecurityConfig(WifiAwareDataPathSecurityConfig)來指定。傳輸協定號碼由網際網路號碼分配機構(IANA)分配。https://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml.

Android 參考資料。android.net.wifi.aware.AwareDataPathRequest.Builder.setTransportProtocol

本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。

適用於