Lingua

MessageWebSocketControl.MaxMessageSize Proprietà

Definizione

Dimensione massima del messaggio, in byte, per configurare un messaggio WebSocket nell'oggetto MessageWebSocket .

public:
 property unsigned int MaxMessageSize { unsigned int get(); void set(unsigned int value); };
uint32_t MaxMessageSize();

void MaxMessageSize(uint32_t value);
public uint MaxMessageSize { get; set; }
var uInt32 = messageWebSocketControl.maxMessageSize;
messageWebSocketControl.maxMessageSize = uInt32;
Public Property MaxMessageSize As UInteger

Valore della proprietà

UInt32

unsigned int

uint32_t

Dimensione massima del messaggio, in byte, da configurare nell'oggetto MessageWebSocket .

Commenti

La proprietà MaxMessageSize viene utilizzata per configurare le dimensioni massime di un messaggio WebSocket in un oggetto MessageWebSocket . Se un messaggio supera questa dimensione, l'evento MessageReceived verrà generato nell'oggetto MessageWebSocket e il metodo GetDataReader o GetDataStream nel parametro di callback MessageWebSocketMessageReceivedEventArgs avrà esito negativo (con un codice di errore che indica che è stata superata la dimensione massima del messaggio).

Il valore predefinito per la proprietà MaxMessageSize è INFINITE.

La proprietà MaxMessageSize può essere impostata solo prima di chiamare il metodo ConnectAsync nell'oggetto MessageWebSocket . Se MessageWebSocket è già connesso, un tentativo di impostare questa proprietà restituirà un errore.

Si applica a

Vedi anche