Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
System.Net.WebSockets.ServerWebSocket Class Referencesealed

Public Member Functions

 ServerWebSocket (Stream innerStream, string subProtocol, int receiveBufferSize, TimeSpan keepAliveInterval, ArraySegment< byte > internalBuffer)
 
override Task< WebSocketReceiveResultReceiveAsync (ArraySegment< byte > buffer, CancellationToken cancellationToken)
 
virtual async ValueTask< ValueWebSocketReceiveResultReceiveAsync (Memory< byte > buffer, CancellationToken cancellationToken)
 
override Task SendAsync (ArraySegment< byte > buffer, WebSocketMessageType messageType, bool endOfMessage, CancellationToken cancellationToken)
 
virtual ValueTask SendAsync (ReadOnlyMemory< byte > buffer, WebSocketMessageType messageType, bool endOfMessage, CancellationToken cancellationToken)
 
virtual ValueTask SendAsync (ReadOnlyMemory< byte > buffer, WebSocketMessageType messageType, WebSocketMessageFlags messageFlags, CancellationToken cancellationToken=default(CancellationToken))
 
override void Abort ()
 
override Task CloseOutputAsync (WebSocketCloseStatus closeStatus, string statusDescription, CancellationToken cancellationToken)
 
Task CloseOutputAsync (WebSocketCloseStatus closeStatus, string? statusDescription, CancellationToken cancellationToken)
 
override Task CloseAsync (WebSocketCloseStatus closeStatus, string statusDescription, CancellationToken cancellationToken)
 
Task CloseAsync (WebSocketCloseStatus closeStatus, string? statusDescription, CancellationToken cancellationToken)
 
override void Dispose ()
 

Static Public Member Functions

static ArraySegment< byte > CreateClientBuffer (int receiveBufferSize, int sendBufferSize)
 
static ArraySegment< byte > CreateServerBuffer (int receiveBufferSize)
 
static WebSocket CreateFromStream (Stream stream, bool isServer, string? subProtocol, TimeSpan keepAliveInterval)
 
static WebSocket CreateFromStream (Stream stream, WebSocketCreationOptions options)
 
static bool IsApplicationTargeting45 ()
 
static void RegisterPrefixes ()
 
static WebSocket CreateClientWebSocket (Stream innerStream, string? subProtocol, int receiveBufferSize, int sendBufferSize, TimeSpan keepAliveInterval, bool useZeroMaskingKey, ArraySegment< byte > internalBuffer)
 

Protected Member Functions

void StartKeepAliveTimer ()
 

Static Protected Member Functions

static void ThrowOnInvalidState (WebSocketState state, params WebSocketState[] validStates)
 
static bool IsStateTerminal (WebSocketState state)
 

Package Functions

void ValidateNativeBuffers (WebSocketProtocolComponent.Action action, WebSocketProtocolComponent.BufferType bufferType, global::Interop.WebSocket.Buffer[] dataBuffers, uint dataBufferCount)
 

Static Package Functions

static WebSocket Create (Stream innerStream, string subProtocol, int receiveBufferSize, TimeSpan keepAliveInterval, ArraySegment< byte > internalBuffer)
 

Properties

override SafeHandle SessionHandle [get]
 
override WebSocketState State [get]
 
override string SubProtocol [get]
 
override? WebSocketCloseStatus CloseStatus [get]
 
override string CloseStatusDescription [get]
 
WebSocketBuffer InternalBuffer [get]
 
static TimeSpan DefaultKeepAliveInterval [get]
 

Private Member Functions

SafeHandle CreateWebSocketHandle ()
 
async Task< WebSocketReceiveResultReceiveAsyncCore (ArraySegment< byte > buffer, CancellationToken cancellationToken)
 
async Task SendAsyncCore (ArraySegment< byte > buffer, WebSocketMessageType messageType, bool endOfMessage, CancellationToken cancellationToken)
 
async Task SendFrameAsync (IList< ArraySegment< byte > > sendBuffers, CancellationToken cancellationToken)
 
async Task CloseOutputAsyncCore (WebSocketCloseStatus closeStatus, string statusDescription, CancellationToken cancellationToken)
 
bool OnCloseOutputCompleted ()
 
async Task< boolStartOnCloseCompleted (bool thisLockTakenSnapshot, bool sessionHandleLockTakenSnapshot, CancellationToken cancellationToken)
 
void FinishOnCloseCompleted ()
 
async Task CloseAsyncCore (WebSocketCloseStatus closeStatus, string statusDescription, CancellationToken cancellationToken)
 
void ResetFlagAndTakeLock (object lockObject, ref bool thisLockTaken)
 
void ResetFlagsAndTakeLocks (ref bool thisLockTaken, ref bool sessionHandleLockTaken)
 
void TakeLocks (ref bool thisLockTaken, ref bool sessionHandleLockTaken)
 
void ReleaseLocks (ref bool thisLockTaken, ref bool sessionHandleLockTaken)
 
void EnsureReceiveOperation ()
 
void EnsureSendOperation ()
 
void EnsureKeepAliveOperation ()
 
void EnsureCloseOutputOperation ()
 
void ThrowIfAborted (bool aborted, Exception innerException)
 
bool CanHandleExceptionDuringClose (Exception error)
 
void ThrowIfConvertibleException (string methodName, Exception exception, CancellationToken cancellationToken, bool aborted)
 
void CleanUp ()
 
void OnBackgroundTaskException (Exception exception)
 
void ThrowIfPendingException ()
 
void ThrowIfDisposed ()
 
void UpdateReceiveState (int newReceiveState, int expectedReceiveState)
 
bool StartOnCloseReceived (ref bool thisLockTaken)
 
void FinishOnCloseReceived (WebSocketCloseStatus closeStatus, string closeStatusDescription)
 
async ValueTask SendWithArrayPoolAsync (ReadOnlyMemory< byte > buffer, WebSocketMessageType messageType, bool endOfMessage, CancellationToken cancellationToken)
 

Static Private Member Functions

static void ReleaseLock (object lockObject, ref bool lockTaken)
 
static WebSocketProtocolComponent.BufferType GetBufferType (WebSocketMessageType messageType, bool endOfMessage)
 
static WebSocketMessageType GetMessageType (WebSocketProtocolComponent.BufferType bufferType)
 
static async void OnKeepAlive (object sender)
 

Private Attributes

readonly SafeHandle _sessionHandle
 
readonly global::Interop.WebSocket.Property[] _properties
 
readonly OutstandingOperationHelper _closeOutstandingOperationHelper
 
readonly OutstandingOperationHelper _closeOutputOutstandingOperationHelper
 
readonly OutstandingOperationHelper _receiveOutstandingOperationHelper
 
readonly OutstandingOperationHelper _sendOutstandingOperationHelper
 
readonly Stream _innerStream
 
readonly IWebSocketStream _innerStreamAsWebSocketStream
 
readonly string _subProtocol
 
readonly SemaphoreSlim _sendFrameThrottle
 
readonly object _thisLock
 
readonly WebSocketBuffer _internalBuffer
 
readonly KeepAliveTracker _keepAliveTracker
 
volatile bool _cleanedUp
 
volatile TaskCompletionSource _closeReceivedTaskCompletionSource
 
volatile Task _closeOutputTask
 
volatile bool _isDisposed
 
volatile Task _closeNetworkConnectionTask
 
volatile bool _closeAsyncStartedReceive
 
volatile WebSocketState _state
 
volatile Task _keepAliveTask
 
volatile WebSocketOperation.ReceiveOperation _receiveOperation
 
volatile WebSocketOperation.SendOperation _sendOperation
 
volatile WebSocketOperation.SendOperation _keepAliveOperation
 
volatile WebSocketOperation.CloseOutputOperation _closeOutputOperation
 
WebSocketCloseStatus_closeStatus
 
string _closeStatusDescription
 
int _receiveState
 
Exception _pendingException
 

Detailed Description

Definition at line 6 of file ServerWebSocket.cs.


The documentation for this class was generated from the following file: