WebSocket.CreateClientWebSocket(Stream, String, Int32, Int32, TimeSpan, Boolean, ArraySegment<Byte>) Metodo

Definizione

Consente ai chiamanti di creare una classe WebSocket lato client che utilizzerà il WSPC a scopo di framing.Allows callers to create a client side WebSocket class which will use the WSPC for framing purposes.

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);
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.The connection to be used for IO operations.

subProtocol
String

Sottoprotocollo accettato dal client.The subprotocol accepted by the client.

receiveBufferSize
Int32

Dimensioni, in byte, del buffer di ricezione WebSocket del client.The size in bytes of the client WebSocket receive buffer.

sendBufferSize
Int32

Dimensioni, in byte, del buffer di invio WebSocket del client.The size in bytes of the client WebSocket send buffer.

keepAliveInterval
TimeSpan

Determina la frequenza con la quale un frame viene inviato sulla connessione come keep-alive.Determines how regularly a frame is sent over the connection as a keep-alive. Si applica solo quando la connessione è inattiva.Applies only when the connection is idle.

useZeroMaskingKey
Boolean

Indica se una chiave casuale o una chiave statica (solo zeri) deve essere utilizzata per il mascheramento WebSocket.Indicates whether a random key or a static key (just zeros) should be used for the WebSocket masking.

internalBuffer
ArraySegment<Byte>

Verrà utilizzato come buffer interno del WPC.Will be used as the internal buffer in the WPC. Le dimensioni devono essere pari almeno a 2 * ReceiveBufferSize + SendBufferSize + 256 + 20 (16 su 32 bit).The size has to be at least 2 * ReceiveBufferSize + SendBufferSize + 256 + 20 (16 on 32-bit).

Restituisce

Restituisce WebSocket.Returns WebSocket.

Si applica a