Files
niko 8fc35183db a
2026-04-11 22:19:20 +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: 0x0200032A RID: 810
[Token(Token = "0x200032A")]
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: 0x17000443 RID: 1091
// (get) Token: 0x0600150B RID: 5387
[Token(Token = "0x17000443")]
public abstract WebSocketState State
{
[Token(Token = "0x600150B")]
[Address(Slot = "5")]
get;
}
/// <summary>Aborts the WebSocket connection and cancels any pending IO operations.</summary>
// Token: 0x0600150C RID: 5388
[Token(Token = "0x600150C")]
[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: 0x0600150D RID: 5389
[Token(Token = "0x600150D")]
[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: 0x0600150E RID: 5390
[Token(Token = "0x600150E")]
[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: 0x0600150F RID: 5391
[Token(Token = "0x600150F")]
[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: 0x06001510 RID: 5392
[Token(Token = "0x6001510")]
[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: 0x17000444 RID: 1092
// (get) Token: 0x06001511 RID: 5393 RVA: 0x00009618 File Offset: 0x00007818
[Token(Token = "0x17000444")]
public static TimeSpan DefaultKeepAliveInterval
{
[Token(Token = "0x6001511")]
[Address(RVA = "0x40C170", Offset = "0x40AF70", VA = "0x18040C170")]
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: 0x06001512 RID: 5394 RVA: 0x00002050 File Offset: 0x00000250
[Token(Token = "0x6001512")]
[Address(RVA = "0x40BD60", Offset = "0x40AB60", VA = "0x18040BD60")]
[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: 0x06001513 RID: 5395 RVA: 0x00002053 File Offset: 0x00000253
[Token(Token = "0x6001513")]
[Address(RVA = "0x3F5100", Offset = "0x3F3F00", VA = "0x1803F5100")]
protected WebSocket()
{
}
}
}