42 private global::Interop.HttpApi.HTTP_DATA_CHUNK[]
_dataChunks;
209 _dataChunks =
new global::Interop.HttpApi.HTTP_DATA_CHUNK[2];
211 _dataChunks[0] =
default(global::Interop.HttpApi.HTTP_DATA_CHUNK);
212 _dataChunks[0].DataChunkType = global::Interop.HttpApi.HTTP_DATA_CHUNK_TYPE.HttpDataChunkFromMemory;
213 _dataChunks[1] =
default(global::Interop.HttpApi.HTTP_DATA_CHUNK);
214 _dataChunks[1].DataChunkType = global::Interop.HttpApi.HTTP_DATA_CHUNK_TYPE.HttpDataChunkFromMemory;
493 else if (
count > 131072)
501 if (num != 0 && num != 997 && num != 38)
608 _writeEventArgs.BufferList =
null;
631 global::Interop.HttpApi.HTTP_FLAGS
hTTP_FLAGS = global::Interop.HttpApi.HTTP_FLAGS.NONE;
644 hTTP_FLAGS |= global::Interop.HttpApi.HTTP_FLAGS.HTTP_RECEIVE_REQUEST_FLAG_COPY_BODY;
648 hTTP_FLAGS |= global::Interop.HttpApi.HTTP_FLAGS.HTTP_SEND_RESPONSE_FLAG_MORE_DATA;
649 hTTP_FLAGS |= global::Interop.HttpApi.HTTP_FLAGS.HTTP_SEND_RESPONSE_FLAG_BUFFER_DATA;
653 if (num != 0 && num != 997)
static readonly Microsoft.Win32.SafeHandles.SafeLocalAllocHandle Zero
static bool HasShutdownStarted
static void SuppressFinalize(object obj)
Task WriteAsync(byte[] buffer, int offset, int count)
Task< int > ReadAsync(byte[] buffer, int offset, int count)
virtual void WriteByte(byte value)
ThreadPoolBoundHandle RequestQueueBoundHandle
SafeHandle RequestQueueHandle
static readonly bool SkipIOCPCallbackOnSuccess
override int Read(byte[] buffer, int offset, int count)
override int EndRead(IAsyncResult asyncResult)
uint GetChunks(byte[] buffer, int offset, int size)
bool BufferedDataChunksAvailable
override IAsyncResult BeginRead(byte[] buffer, int offset, int count, AsyncCallback callback, object state)
HttpListenerContext InternalHttpContext
override IAsyncResult BeginWrite(byte[] buffer, int offset, int count, AsyncCallback callback, object state)
override void Write(byte[] buffer, int offset, int count)
HttpListenerContext InternalHttpContext
override Task FlushAsync(CancellationToken cancellationToken)
override void EndWrite(IAsyncResult asyncResult)
static readonly System.Net.NetEventSource Log
static void Error(object thisOrContextObject, FormattableString formattableString, [CallerMemberName] string memberName=null)
static void Associate(object first, object second, [CallerMemberName] string memberName=null)
static void DumpBuffer(object thisOrContextObject, byte[] buffer, int offset, int count, [CallerMemberName] string memberName=null)
WebSocketBuffer InternalBuffer
bool IsInternalBuffer(byte[] buffer, int offset, int count)
IntPtr ConvertPinnedSendPayloadToNative(ArraySegment< byte > payload)
IntPtr ToIntPtr(int offset)
unsafe void InitializeOverlapped(ThreadPoolBoundHandle boundHandle)
void FinishOperationFailure(Exception exception, bool syncCompletion)
IList< ArraySegment< byte > > BufferList
void StartOperationCommon(WebSocketHttpListenerDuplexStream currentStream, ThreadPoolBoundHandle boundHandle)
void OnCompleted(HttpListenerAsyncEventArgs e)
unsafe void FreeOverlapped(bool checkForShutdown)
void StartOperationReceive()
unsafe void UpdateDataChunk(int index, byte[] buffer, int offset, int count)
unsafe void CompletionPortCallback(uint errorCode, uint numBytes, NativeOverlapped *nativeOverlapped)
void SetShouldCloseOutput()
void StartOperationSend()
HttpListenerAsyncOperation _completedOperation
readonly WebSocketBase _webSocket
unsafe NativeOverlapped * _ptrNativeOverlapped
HttpListenerAsyncEventArgs(WebSocketBase webSocket, WebSocketHttpListenerDuplexStream stream)
HttpListenerAsyncOperation
global::Interop.HttpApi.HTTP_DATA_CHUNK[] _dataChunks
void SetResults(Exception exception, int bytesTransferred)
ThreadPoolBoundHandle _boundHandle
WebSocketHttpListenerDuplexStream CurrentStream
void SetBuffer(byte[] buffer, int offset, int count)
EventHandler< HttpListenerAsyncEventArgs > Completed
EventHandler< HttpListenerAsyncEventArgs > m_Completed
readonly WebSocketHttpListenerDuplexStream _currentStream
GCHandle _dataChunksGCHandle
IList< ArraySegment< byte > > _bufferList
void FinishOperationSuccess(int bytesTransferred, bool syncCompletion)
async Task< int > ReadAsyncCore(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
override Task FlushAsync(CancellationToken cancellationToken)
static readonly Func< Exception, bool > s_CanHandleException
async Task MultipleWriteAsyncCore(IList< ArraySegment< byte > > sendBuffers, CancellationToken cancellationToken)
override void Write(byte[] buffer, int offset, int count)
override void Dispose(bool disposing)
static void OnReadCompleted(object sender, HttpListenerAsyncEventArgs eventArgs)
override long Seek(long offset, SeekOrigin origin)
override IAsyncResult BeginWrite(byte[] buffer, int offset, int count, AsyncCallback callback, object state)
static void OnWriteCompleted(object sender, HttpListenerAsyncEventArgs eventArgs)
async Task WriteAsyncCore(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
readonly HttpResponseStream _outputStream
static readonly Action< object > s_OnCancel
HttpListenerAsyncEventArgs _readEventArgs
HttpListenerAsyncEventArgs _writeEventArgs
TaskCompletionSource _writeTaskCompletionSource
void SwitchToOpaqueMode(WebSocketBase webSocket)
override int Read(byte[] buffer, int offset, int count)
override void SetLength(long value)
unsafe bool ReadAsyncFast(HttpListenerAsyncEventArgs eventArgs)
static bool CanHandleException(Exception error)
Task MultipleWriteAsync(IList< ArraySegment< byte > > sendBuffers, CancellationToken cancellationToken)
static void OnCancel(object state)
override Task< int > ReadAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
static readonly EventHandler< HttpListenerAsyncEventArgs > s_OnWriteCompleted
TaskCompletionSource< int > _readTaskCompletionSource
override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
bool SupportsMultipleWrite
readonly HttpRequestStream _inputStream
override void EndWrite(IAsyncResult asyncResult)
static readonly EventHandler< HttpListenerAsyncEventArgs > s_OnReadCompleted
async Task CloseNetworkConnectionAsync(CancellationToken cancellationToken)
WebSocketHttpListenerDuplexStream(HttpRequestStream inputStream, HttpResponseStream outputStream, HttpListenerContext context)
unsafe bool WriteAsyncFast(HttpListenerAsyncEventArgs eventArgs)
override int EndRead(IAsyncResult asyncResult)
readonly HttpListenerContext _context
override void WriteByte(byte value)
override IAsyncResult BeginRead(byte[] buffer, int offset, int count, AsyncCallback callback, object state)
static void ValidateBuffer(byte[] buffer, int offset, int count)
static unsafe IntPtr UnsafeAddrOfPinnedArrayElement(Array arr, int index)
static int CompareExchange(ref int location1, int value, int comparand)
static int Exchange(ref int location1, int value)
static YieldAwaitable Yield()
unsafe void FreeNativeOverlapped(NativeOverlapped *overlapped)
static readonly IntPtr Zero
static GCHandle Alloc(object? value)