Files
niko c12fbe3fc6 m
2026-04-12 16:51:38 +02:00

111 lines
6.2 KiB
C#

using System;
using System.ComponentModel;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
using Cpp2IlInjected;
namespace System.Net.WebSockets
{
/// <summary>The WebSocket class allows applications to send and receive data after the WebSocket upgrade has completed.</summary>
// Token: 0x02000326 RID: 806
[Token(Token = "0x2000326")]
public abstract class WebSocket : IDisposable
{
/// <summary>Returns the current state of the WebSocket connection.</summary>
/// <returns>The current state of the WebSocket connection.</returns>
// Token: 0x1700043F RID: 1087
// (get) Token: 0x060014F5 RID: 5365
[Token(Token = "0x1700043F")]
public abstract WebSocketState State
{
[Token(Token = "0x60014F5")]
[Address(Slot = "5")]
get;
}
/// <summary>Aborts the WebSocket connection and cancels any pending IO operations.</summary>
// Token: 0x060014F6 RID: 5366
[Token(Token = "0x60014F6")]
[Address(Slot = "6")]
public abstract void Abort();
/// <summary>Initiates or completes the close handshake defined in the WebSocket protocol specification section 7.</summary>
/// <param name="closeStatus">Indicates the reason for closing the WebSocket connection.</param>
/// <param name="statusDescription">Allows applications to specify a human readable explanation as to why the connection is closed.</param>
/// <param name="cancellationToken">The token that can be used to propagate notification that operations should be canceled.</param>
/// <returns>The task object representing the asynchronous operation.</returns>
// Token: 0x060014F7 RID: 5367
[Token(Token = "0x60014F7")]
[Address(Slot = "7")]
public abstract Task CloseOutputAsync(WebSocketCloseStatus closeStatus, string statusDescription, CancellationToken cancellationToken);
/// <summary>Used to clean up unmanaged resources for ASP.NET and self-hosted implementations.</summary>
// Token: 0x060014F8 RID: 5368
[Token(Token = "0x60014F8")]
[Address(Slot = "8")]
public abstract void Dispose();
/// <summary>Receives data from the <see cref="T:System.Net.WebSockets.WebSocket" /> connection asynchronously.</summary>
/// <param name="buffer">References the application buffer that is the storage location for the received data.</param>
/// <param name="cancellationToken">Propagates the notification that operations should be canceled.</param>
/// <returns>The task object representing the asynchronous operation. The <see cref="P:System.Threading.Tasks.Task`1.Result" /> property on the task object returns a <see cref="T:System.Byte" /> array containing the received data.</returns>
// Token: 0x060014F9 RID: 5369
[Token(Token = "0x60014F9")]
[Address(Slot = "9")]
public abstract Task<WebSocketReceiveResult> ReceiveAsync(ArraySegment<byte> buffer, CancellationToken cancellationToken);
/// <summary>Sends data over the <see cref="T:System.Net.WebSockets.WebSocket" /> connection asynchronously.</summary>
/// <param name="buffer">The buffer to be sent over the connection.</param>
/// <param name="messageType">Indicates whether the application is sending a binary or text message.</param>
/// <param name="endOfMessage">Indicates whether the data in "buffer" is the last part of a message.</param>
/// <param name="cancellationToken">The token that propagates the notification that operations should be canceled.</param>
/// <returns>The task object representing the asynchronous operation.</returns>
// Token: 0x060014FA RID: 5370
[Token(Token = "0x60014FA")]
[Address(Slot = "10")]
public abstract Task SendAsync(ArraySegment<byte> buffer, WebSocketMessageType messageType, bool endOfMessage, CancellationToken cancellationToken);
/// <summary>Gets the default WebSocket protocol keep-alive interval.</summary>
/// <returns>The default WebSocket protocol keep-alive interval. The typical value for this interval is 30 seconds (as defined by the OS or the .NET platform). It is used to initialize <see cref="P:System.Net.WebSockets.ClientWebSocketOptions.KeepAliveInterval" /> value.</returns>
// Token: 0x17000440 RID: 1088
// (get) Token: 0x060014FB RID: 5371 RVA: 0x00009600 File Offset: 0x00007800
[Token(Token = "0x17000440")]
public static TimeSpan DefaultKeepAliveInterval
{
[Token(Token = "0x60014FB")]
[Address(RVA = "0x77D820", Offset = "0x77C820", VA = "0x18077D820")]
get
{
return default(TimeSpan);
}
}
/// <summary>Allows callers to create a client side WebSocket class which will use the WSPC for framing purposes.</summary>
/// <param name="innerStream">The connection to be used for IO operations.</param>
/// <param name="subProtocol">The subprotocol accepted by the client.</param>
/// <param name="receiveBufferSize">The size in bytes of the client WebSocket receive buffer.</param>
/// <param name="sendBufferSize">The size in bytes of the client WebSocket send buffer.</param>
/// <param name="keepAliveInterval">Determines how regularly a frame is sent over the connection as a keep-alive. Applies only when the connection is idle.</param>
/// <param name="useZeroMaskingKey">Indicates whether a random key or a static key (just zeros) should be used for the WebSocket masking.</param>
/// <param name="internalBuffer">Will be used as the internal buffer in the WPC. The size has to be at least <c>2 * ReceiveBufferSize + SendBufferSize + 256 + 20 (16 on 32-bit)</c>.</param>
/// <returns>Returns <see cref="T:System.Net.WebSockets.WebSocket" />.</returns>
// Token: 0x060014FC RID: 5372 RVA: 0x00002050 File Offset: 0x00000250
[Token(Token = "0x60014FC")]
[Address(RVA = "0x77D410", Offset = "0x77C410", VA = "0x18077D410")]
[EditorBrowsable(EditorBrowsableState.Never)]
public static WebSocket CreateClientWebSocket(Stream innerStream, string subProtocol, int receiveBufferSize, int sendBufferSize, TimeSpan keepAliveInterval, bool useZeroMaskingKey, ArraySegment<byte> internalBuffer)
{
return null;
}
/// <summary>Creates an instance of the <see cref="T:System.Net.WebSockets.WebSocket" /> class.</summary>
// Token: 0x060014FD RID: 5373 RVA: 0x00002053 File Offset: 0x00000253
[Token(Token = "0x60014FD")]
[Address(RVA = "0x412370", Offset = "0x411370", VA = "0x180412370")]
protected WebSocket()
{
}
}
}