WebSocketProtocol.CreateFromStream(Stream, Boolean, String, TimeSpan) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Creates a new WebSocket connection that operates on the specified stream.
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);
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
Parameters
- stream
- Stream
The stream for the connection.
- isServer
- Boolean
true
to indicate it's the server-side of the connection; false
if it's the client-side.
- subProtocol
- String
The agreed upon sub-protocol that was used when creating the connection.
- keepAliveInterval
- TimeSpan
The keep-alive interval to use, or InfiniteTimeSpan to disable keep-alives.
Returns
The new WebSocket connection.
Applies to
ทํางานร่วมกับเราใน GitHub
แหล่งที่มาสำหรับเนื้อหานี้สามารถพบได้บน GitHub ซึ่งคุณยังสามารถสร้างและตรวจสอบปัญหาและคำขอดึงข้อมูลได้ สำหรับข้อมูลเพิ่มเติม ให้ดูคู่มือผู้สนับสนุนของเรา