WebSocket.CreateClientWebSocket Metodo

Definizione

Consente ai chiamanti di creare una classe WebSocket sul lato client che userà WSPC a scopo di frame.

Questa API supporta l'infrastruttura del prodotto e non è previsto che venga usata direttamente dal codice.

public:
 static System::Net::WebSockets::WebSocket ^ CreateClientWebSocket(System::IO::Stream ^ innerStream, System::String ^ subProtocol, int receiveBufferSize, int sendBufferSize, TimeSpan keepAliveInterval, bool useZeroMaskingKey, ArraySegment<System::Byte> internalBuffer);
public static System.Net.WebSockets.WebSocket CreateClientWebSocket(System.IO.Stream innerStream, string? subProtocol, int receiveBufferSize, int sendBufferSize, TimeSpan keepAliveInterval, bool useZeroMaskingKey, ArraySegment<byte> internalBuffer);
public static System.Net.WebSockets.WebSocket CreateClientWebSocket(System.IO.Stream innerStream, string subProtocol, int receiveBufferSize, int sendBufferSize, TimeSpan keepAliveInterval, bool useZeroMaskingKey, ArraySegment<byte> internalBuffer);
static member CreateClientWebSocket : System.IO.Stream * string * int * int * TimeSpan * bool * ArraySegment<byte> -> System.Net.WebSockets.WebSocket
Public Shared Function CreateClientWebSocket (innerStream As Stream, subProtocol As String, receiveBufferSize As Integer, sendBufferSize As Integer, keepAliveInterval As TimeSpan, useZeroMaskingKey As Boolean, internalBuffer As ArraySegment(Of Byte)) As WebSocket

Parametri

innerStream
Stream

Connessione da usare per le operazioni di I/O.

subProtocol
String

Sottoprotocolo accettato dal client.

receiveBufferSize
Int32

Dimensione in byte del buffer di ricezione webSocket del client.

sendBufferSize
Int32

Dimensioni in byte del buffer di invio WebSocket client.

keepAliveInterval
TimeSpan

Determina la frequenza con cui un frame viene inviato tramite la connessione come keep-alive. Si applica solo quando la connessione è inattiva.

useZeroMaskingKey
Boolean

Indica se per la maschera WebSocket deve essere usata una chiave casuale o una chiave statica (solo zeri).

internalBuffer
ArraySegment<Byte>

Verrà usato come buffer interno nel WPC. Le dimensioni devono essere almeno 2 * ReceiveBufferSize + SendBufferSize + 256 + 20 (16 on 32-bit).

Valori restituiti

Restituisce WebSocket.

Si applica a