WebSocket.CreateClientWebSocket Metodo

Definizione

Consente ai chiamanti di creare una classe WebSocket lato client che utilizzerà il WSPC a scopo di framing.

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 utilizzare per le operazioni di I/O.

subProtocol
String

Sottoprotocollo accettato dal client.

receiveBufferSize
Int32

Dimensioni, in byte, del buffer di ricezione WebSocket del client.

sendBufferSize
Int32

Dimensioni, in byte, del buffer di invio WebSocket del client.

keepAliveInterval
TimeSpan

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

useZeroMaskingKey
Boolean

Indica se una chiave casuale o una chiave statica (solo zeri) deve essere utilizzata per il mascheramento WebSocket.

internalBuffer
ArraySegment<Byte>

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

Restituisce

Restituisce WebSocket.

Si applica a