WebSocket.CreateFromStream 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
CreateFromStream(Stream, WebSocketCreationOptions) | |
CreateFromStream(Stream, Boolean, String, TimeSpan) |
创建在指定流上操作的新 WebSocket 对象,它表示一个 Web 套接字连接。 |
CreateFromStream(Stream, WebSocketCreationOptions)
- Source:
- WebSocket.cs
- Source:
- WebSocket.cs
- Source:
- WebSocket.cs
public:
static System::Net::WebSockets::WebSocket ^ CreateFromStream(System::IO::Stream ^ stream, System::Net::WebSockets::WebSocketCreationOptions ^ options);
public static System.Net.WebSockets.WebSocket CreateFromStream (System.IO.Stream stream, System.Net.WebSockets.WebSocketCreationOptions options);
static member CreateFromStream : System.IO.Stream * System.Net.WebSockets.WebSocketCreationOptions -> System.Net.WebSockets.WebSocket
Public Shared Function CreateFromStream (stream As Stream, options As WebSocketCreationOptions) As WebSocket
参数
- options
- WebSocketCreationOptions
必须用来创建 websocket 的选项。
返回
创建的 Web 套接字。
适用于
CreateFromStream(Stream, Boolean, String, TimeSpan)
- Source:
- WebSocket.cs
- Source:
- WebSocket.cs
- Source:
- WebSocket.cs
创建在指定流上操作的新 WebSocket 对象,它表示一个 Web 套接字连接。
public:
static System::Net::WebSockets::WebSocket ^ CreateFromStream(System::IO::Stream ^ stream, bool isServer, System::String ^ subProtocol, TimeSpan keepAliveInterval);
public static System.Net.WebSockets.WebSocket CreateFromStream (System.IO.Stream stream, bool isServer, string? subProtocol, TimeSpan keepAliveInterval);
public static System.Net.WebSockets.WebSocket CreateFromStream (System.IO.Stream stream, bool isServer, string subProtocol, TimeSpan keepAliveInterval);
static member CreateFromStream : System.IO.Stream * bool * string * TimeSpan -> System.Net.WebSockets.WebSocket
Public Shared Function CreateFromStream (stream As Stream, isServer As Boolean, subProtocol As String, keepAliveInterval As TimeSpan) As WebSocket
参数
- stream
- Stream
连接的流。
- isServer
- Boolean
要指示它是连接的服务器端,则为 true
;如果是客户端,则为 false
。
- subProtocol
- String
创建连接时使用的已约定的子协议。
- keepAliveInterval
- TimeSpan
要使用的保持活动状态间隔,或禁用保持活动状态的 InfiniteTimeSpan。
返回
新的 Web 套接字。