1 // Licensed to the .NET Foundation under one or more agreements.
2 // The .NET Foundation licenses this file to you under the MIT license.
3 // See the LICENSE file in the project root for more information.
4 // ------------------------------------------------------------------------------
5 // Changes to this file must follow the http://aka.ms/api-review process.
6 // ------------------------------------------------------------------------------
7 
8 namespace System.Net.WebSockets
9 {
10     public readonly partial struct ValueWebSocketReceiveResult
11     {
12         private readonly int _dummy;
ValueWebSocketReceiveResultSystem.Net.WebSockets.ValueWebSocketReceiveResult13         public ValueWebSocketReceiveResult(int count, System.Net.WebSockets.WebSocketMessageType messageType, bool endOfMessage) { throw null; }
14         public int Count { get { throw null; } }
15         public bool EndOfMessage { get { throw null; } }
16         public System.Net.WebSockets.WebSocketMessageType MessageType { get { throw null; } }
17     }
18     public abstract partial class WebSocket : System.IDisposable
19     {
WebSocket()20         protected WebSocket() { }
21         public abstract System.Nullable<System.Net.WebSockets.WebSocketCloseStatus> CloseStatus { get; }
22         public abstract string CloseStatusDescription { get; }
23         public static System.TimeSpan DefaultKeepAliveInterval { get { throw null; } }
24         public abstract System.Net.WebSockets.WebSocketState State { get; }
25         public abstract string SubProtocol { get; }
Abort()26         public abstract void Abort();
CloseAsync(System.Net.WebSockets.WebSocketCloseStatus closeStatus, string statusDescription, System.Threading.CancellationToken cancellationToken)27         public abstract System.Threading.Tasks.Task CloseAsync(System.Net.WebSockets.WebSocketCloseStatus closeStatus, string statusDescription, System.Threading.CancellationToken cancellationToken);
CloseOutputAsync(System.Net.WebSockets.WebSocketCloseStatus closeStatus, string statusDescription, System.Threading.CancellationToken cancellationToken)28         public abstract System.Threading.Tasks.Task CloseOutputAsync(System.Net.WebSockets.WebSocketCloseStatus closeStatus, string statusDescription, System.Threading.CancellationToken cancellationToken);
CreateClientBuffer(int receiveBufferSize, int sendBufferSize)29         public static System.ArraySegment<byte> CreateClientBuffer(int receiveBufferSize, int sendBufferSize) { throw null; }
30         [System.ComponentModel.EditorBrowsableAttribute((System.ComponentModel.EditorBrowsableState)(1))]
CreateClientWebSocket(System.IO.Stream innerStream, string subProtocol, int receiveBufferSize, int sendBufferSize, System.TimeSpan keepAliveInterval, bool useZeroMaskingKey, System.ArraySegment<byte> internalBuffer)31         public static System.Net.WebSockets.WebSocket CreateClientWebSocket(System.IO.Stream innerStream, string subProtocol, int receiveBufferSize, int sendBufferSize, System.TimeSpan keepAliveInterval, bool useZeroMaskingKey, System.ArraySegment<byte> internalBuffer) { throw null; }
CreateFromStream(System.IO.Stream stream, bool isServer, string subProtocol, System.TimeSpan keepAliveInterval, System.Memory<byte> buffer=default(System.Memory<byte>))32         public static System.Net.WebSockets.WebSocket CreateFromStream(System.IO.Stream stream, bool isServer, string subProtocol, System.TimeSpan keepAliveInterval, System.Memory<byte> buffer=default(System.Memory<byte>)) { throw null; }
CreateServerBuffer(int receiveBufferSize)33         public static System.ArraySegment<byte> CreateServerBuffer(int receiveBufferSize) { throw null; }
Dispose()34         public abstract void Dispose();
35         [System.ComponentModel.EditorBrowsableAttribute((System.ComponentModel.EditorBrowsableState)(1))]
36         [System.ObsoleteAttribute("This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.")]
IsApplicationTargeting45()37         public static bool IsApplicationTargeting45() { throw null; }
IsStateTerminal(System.Net.WebSockets.WebSocketState state)38         protected static bool IsStateTerminal(System.Net.WebSockets.WebSocketState state) { throw null; }
ReceiveAsync(System.ArraySegment<byte> buffer, System.Threading.CancellationToken cancellationToken)39         public abstract System.Threading.Tasks.Task<System.Net.WebSockets.WebSocketReceiveResult> ReceiveAsync(System.ArraySegment<byte> buffer, System.Threading.CancellationToken cancellationToken);
ReceiveAsync(System.Memory<byte> buffer, System.Threading.CancellationToken cancellationToken)40         public virtual System.Threading.Tasks.ValueTask<System.Net.WebSockets.ValueWebSocketReceiveResult> ReceiveAsync(System.Memory<byte> buffer, System.Threading.CancellationToken cancellationToken) { throw null; }
41         [System.ComponentModel.EditorBrowsableAttribute((System.ComponentModel.EditorBrowsableState)(1))]
RegisterPrefixes()42         public static void RegisterPrefixes() { }
SendAsync(System.ArraySegment<byte> buffer, System.Net.WebSockets.WebSocketMessageType messageType, bool endOfMessage, System.Threading.CancellationToken cancellationToken)43         public abstract System.Threading.Tasks.Task SendAsync(System.ArraySegment<byte> buffer, System.Net.WebSockets.WebSocketMessageType messageType, bool endOfMessage, System.Threading.CancellationToken cancellationToken);
SendAsync(System.ReadOnlyMemory<byte> buffer, System.Net.WebSockets.WebSocketMessageType messageType, bool endOfMessage, System.Threading.CancellationToken cancellationToken)44         public virtual System.Threading.Tasks.Task SendAsync(System.ReadOnlyMemory<byte> buffer, System.Net.WebSockets.WebSocketMessageType messageType, bool endOfMessage, System.Threading.CancellationToken cancellationToken) { throw null; }
ThrowOnInvalidState(System.Net.WebSockets.WebSocketState state, params System.Net.WebSockets.WebSocketState[] validStates)45         protected static void ThrowOnInvalidState(System.Net.WebSockets.WebSocketState state, params System.Net.WebSockets.WebSocketState[] validStates) { }
46     }
47     public enum WebSocketCloseStatus
48     {
49         Empty = 1005,
50         EndpointUnavailable = 1001,
51         InternalServerError = 1011,
52         InvalidMessageType = 1003,
53         InvalidPayloadData = 1007,
54         MandatoryExtension = 1010,
55         MessageTooBig = 1009,
56         NormalClosure = 1000,
57         PolicyViolation = 1008,
58         ProtocolError = 1002,
59     }
60     public abstract partial class WebSocketContext
61     {
62         public abstract System.Net.CookieCollection CookieCollection { get; }
63         public abstract System.Collections.Specialized.NameValueCollection Headers { get; }
64         public abstract bool IsAuthenticated { get; }
65         public abstract bool IsLocal { get; }
66         public abstract bool IsSecureConnection { get; }
67         public abstract string Origin { get; }
68         public abstract System.Uri RequestUri { get; }
69         public abstract string SecWebSocketKey { get; }
70         public abstract System.Collections.Generic.IEnumerable<string> SecWebSocketProtocols { get; }
71         public abstract string SecWebSocketVersion { get; }
72         public abstract System.Security.Principal.IPrincipal User { get; }
73         public abstract System.Net.WebSockets.WebSocket WebSocket { get; }
74     }
75     public enum WebSocketError
76     {
77         ConnectionClosedPrematurely = 8,
78         Faulted = 2,
79         HeaderError = 7,
80         InvalidMessageType = 1,
81         InvalidState = 9,
82         NativeError = 3,
83         NotAWebSocket = 4,
84         Success = 0,
85         UnsupportedProtocol = 6,
86         UnsupportedVersion = 5,
87     }
88     public sealed partial class WebSocketException : System.ComponentModel.Win32Exception
89     {
WebSocketException()90         public WebSocketException() { }
WebSocketException(int nativeError)91         public WebSocketException(int nativeError) { }
WebSocketException(int nativeError, System.Exception innerException)92         public WebSocketException(int nativeError, System.Exception innerException) { }
WebSocketException(int nativeError, string message)93         public WebSocketException(int nativeError, string message) { }
WebSocketException(System.Net.WebSockets.WebSocketError error)94         public WebSocketException(System.Net.WebSockets.WebSocketError error) { }
WebSocketException(System.Net.WebSockets.WebSocketError error, System.Exception innerException)95         public WebSocketException(System.Net.WebSockets.WebSocketError error, System.Exception innerException) { }
WebSocketException(System.Net.WebSockets.WebSocketError error, int nativeError)96         public WebSocketException(System.Net.WebSockets.WebSocketError error, int nativeError) { }
WebSocketException(System.Net.WebSockets.WebSocketError error, int nativeError, System.Exception innerException)97         public WebSocketException(System.Net.WebSockets.WebSocketError error, int nativeError, System.Exception innerException) { }
WebSocketException(System.Net.WebSockets.WebSocketError error, int nativeError, string message)98         public WebSocketException(System.Net.WebSockets.WebSocketError error, int nativeError, string message) { }
WebSocketException(System.Net.WebSockets.WebSocketError error, int nativeError, string message, System.Exception innerException)99         public WebSocketException(System.Net.WebSockets.WebSocketError error, int nativeError, string message, System.Exception innerException) { }
WebSocketException(System.Net.WebSockets.WebSocketError error, string message)100         public WebSocketException(System.Net.WebSockets.WebSocketError error, string message) { }
WebSocketException(System.Net.WebSockets.WebSocketError error, string message, System.Exception innerException)101         public WebSocketException(System.Net.WebSockets.WebSocketError error, string message, System.Exception innerException) { }
WebSocketException(string message)102         public WebSocketException(string message) { }
WebSocketException(string message, System.Exception innerException)103         public WebSocketException(string message, System.Exception innerException) { }
104         public override int ErrorCode { get { throw null; } }
105         public System.Net.WebSockets.WebSocketError WebSocketErrorCode { get { throw null; } }
GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)106         public override void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
107     }
108     public enum WebSocketMessageType
109     {
110         Binary = 1,
111         Close = 2,
112         Text = 0,
113     }
114     public partial class WebSocketReceiveResult
115     {
WebSocketReceiveResult(int count, System.Net.WebSockets.WebSocketMessageType messageType, bool endOfMessage)116         public WebSocketReceiveResult(int count, System.Net.WebSockets.WebSocketMessageType messageType, bool endOfMessage) { }
WebSocketReceiveResult(int count, System.Net.WebSockets.WebSocketMessageType messageType, bool endOfMessage, System.Nullable<System.Net.WebSockets.WebSocketCloseStatus> closeStatus, string closeStatusDescription)117         public WebSocketReceiveResult(int count, System.Net.WebSockets.WebSocketMessageType messageType, bool endOfMessage, System.Nullable<System.Net.WebSockets.WebSocketCloseStatus> closeStatus, string closeStatusDescription) { }
118         public System.Nullable<System.Net.WebSockets.WebSocketCloseStatus> CloseStatus { get { throw null; } }
119         public string CloseStatusDescription { get { throw null; } }
120         public int Count { get { throw null; } }
121         public bool EndOfMessage { get { throw null; } }
122         public System.Net.WebSockets.WebSocketMessageType MessageType { get { throw null; } }
123     }
124     public enum WebSocketState
125     {
126         Aborted = 6,
127         Closed = 5,
128         CloseReceived = 4,
129         CloseSent = 3,
130         Connecting = 1,
131         None = 0,
132         Open = 2,
133     }
134 }
135