System.Net.WebSockets.WebSocketBuffer.IsPinnedSendPayloadBuffer C# (CSharp) Method

IsPinnedSendPayloadBuffer() private method

private IsPinnedSendPayloadBuffer ( Interop buffer, WebSocketProtocolComponent bufferType ) : bool
buffer Interop
bufferType WebSocketProtocolComponent
return bool
        internal bool IsPinnedSendPayloadBuffer(Interop.WebSocket.Buffer buffer,
            WebSocketProtocolComponent.BufferType bufferType)
        {
            if (_sendBufferState != SendBufferState.SendPayloadSpecified)
            {
                return false;
            }

            IntPtr bufferData;
            uint bufferSize;

            UnwrapWebSocketBuffer(buffer, bufferType, out bufferData, out bufferSize);

            long nativeBufferStartAddress = bufferData.ToInt64();
            long nativeBufferEndAddress = nativeBufferStartAddress + bufferSize;

            return nativeBufferStartAddress >= _pinnedSendBufferStartAddress &&
                nativeBufferEndAddress >= _pinnedSendBufferStartAddress &&
                nativeBufferStartAddress <= _pinnedSendBufferEndAddress &&
                nativeBufferEndAddress <= _pinnedSendBufferEndAddress;
        }

Same methods

WebSocketBuffer::IsPinnedSendPayloadBuffer ( byte buffer, int offset, int count ) : bool