Rediger

Del via


WebSocket.CreateFromStream Method

Definition

Overloads

CreateFromStream(Stream, WebSocketCreationOptions)

Creates a WebSocket that operates on a Stream representing a web socket connection.

CreateFromStream(Stream, Boolean, String, TimeSpan)

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

CreateFromStream(Stream, WebSocketCreationOptions)

Source:
WebSocket.cs
Source:
WebSocket.cs
Source:
WebSocket.cs

Creates a WebSocket that operates on a Stream representing a web socket connection.

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

Parameters

stream
Stream

The Stream for the connection.

options
WebSocketCreationOptions

The options with which the websocket must be created.

Returns

The created web socket.

Applies to

CreateFromStream(Stream, Boolean, String, TimeSpan)

Source:
WebSocket.cs
Source:
WebSocket.cs
Source:
WebSocket.cs

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

Applies to