WebSocket.ThrowOnInvalidState(WebSocketState, WebSocketState[]) 方法

定义

验证连接是否处于预期状态。

protected:
 static void ThrowOnInvalidState(System::Net::WebSockets::WebSocketState state, ... cli::array <System::Net::WebSockets::WebSocketState> ^ validStates);
protected static void ThrowOnInvalidState (System.Net.WebSockets.WebSocketState state, params System.Net.WebSockets.WebSocketState[] validStates);
static member ThrowOnInvalidState : System.Net.WebSockets.WebSocketState * System.Net.WebSockets.WebSocketState[] -> unit
Protected Shared Sub ThrowOnInvalidState (state As WebSocketState, ParamArray validStates As WebSocketState())

参数

state
WebSocketState

要对有效状态的列表测试的 WebSocket 的当前状态。

validStates
WebSocketState[]

有效的连接状态列表。

适用于