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

Definition

Creates a new WebSocket object that operates on the specified stream, which represents a web socket connection.

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

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 web socket.

Applies to