Socket.SetRawSocketOption(Int32, Int32, ReadOnlySpan<Byte>) 方法

定義

使用特定於平台的層級和名稱識別碼來設定通訊端選項值。

public:
 void SetRawSocketOption(int optionLevel, int optionName, ReadOnlySpan<System::Byte> optionValue);
public void SetRawSocketOption (int optionLevel, int optionName, ReadOnlySpan<byte> optionValue);
member this.SetRawSocketOption : int * int * ReadOnlySpan<byte> -> unit
Public Sub SetRawSocketOption (optionLevel As Integer, optionName As Integer, optionValue As ReadOnlySpan(Of Byte))

參數

optionLevel
Int32

平台定義的選項層級。

optionName
Int32

平台定義的選項名稱。

optionValue
ReadOnlySpan<Byte>

選項應設定的值。

例外狀況

嘗試存取通訊端時發生錯誤。

備註

一般而言, SetSocketOption 每當設定 Socket 選項時,應該使用 方法。

SetRawSocketOption(Int32, Int32, ReadOnlySpan<Byte>)只有在 和 SocketOptionName 未公開必要選項時SocketOptionLevel,才應該使用 方法。

適用於