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
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.