WebSocketProtocol.CreateFromStream(Stream, Boolean, String, TimeSpan) Method

Definition

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);
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