WebSocketHelpers Class

Namespace
Microsoft.Net.WebSockets
Assemblies
  • Microsoft.Net.WebSockets.Server

Syntax

public class WebSocketHelpers
class Microsoft.Net.WebSockets.WebSocketHelpers

Properties

Microsoft.Net.WebSockets.WebSocketHelpers.AreWebSocketsSupported
Return type:System.Boolean
public static bool AreWebSocketsSupported { get; }
Microsoft.Net.WebSockets.WebSocketHelpers.DefaultKeepAliveInterval
Return type:System.TimeSpan
public static TimeSpan DefaultKeepAliveInterval { get; }

Methods

CreateServerWebSocket(System.IO.Stream, System.String, System.Int32, System.TimeSpan, System.ArraySegment<System.Byte>)
Return type:System.Net.WebSockets.WebSocket
public static WebSocket CreateServerWebSocket(Stream opaqueStream, string subProtocol, int receiveBufferSize, TimeSpan keepAliveInterval, ArraySegment<byte> internalBuffer)
GetSecWebSocketAcceptString(System.String)
Return type:System.String
[SuppressMessage("Microsoft.Cryptographic.Standard", "CA5354:SHA1CannotBeUsed", Justification = "SHA1 used only for hashing purposes, not for crypto.")]
public static string GetSecWebSocketAcceptString(string secWebSocketKey)
IsValidWebSocketKey(System.String)
Return type:System.Boolean
public static bool IsValidWebSocketKey(string key)
ProcessWebSocketProtocolHeader(System.Collections.Generic.IEnumerable<System.String>, System.String)
Return type:System.Boolean
public static bool ProcessWebSocketProtocolHeader(IEnumerable<string> clientSecWebSocketProtocols, string subProtocol)
ValidateArraySegment<T>(System.ArraySegment<T>, System.String)
public static void ValidateArraySegment<T>(ArraySegment<T> arraySegment, string parameterName)
ValidateOptions(System.String, System.Int32, System.Int32, System.TimeSpan)
public static void ValidateOptions(string subProtocol, int receiveBufferSize, int sendBufferSize, TimeSpan keepAliveInterval)

Fields

DefaultReceiveBufferSize()
Return type:System.Int32
public const int DefaultReceiveBufferSize = 16384
WebSocketUpgradeToken()
Return type:System.String
public const string WebSocketUpgradeToken = "websocket"