Esempio n. 1
0
 private static extern unsafe int http_websockets_write_bytes(
     IntPtr pInProcessHandler,
     HttpApiTypes.HTTP_DATA_CHUNK *pDataChunks,
     int nChunks,
     PFN_WEBSOCKET_ASYNC_COMPLETION pfnCompletionCallback,
     IntPtr pvCompletionContext,
     out bool fCompletionExpected);
Esempio n. 2
0
 public static unsafe int HttpWebsocketsWriteBytes(
     IntPtr pInProcessHandler,
     HttpApiTypes.HTTP_DATA_CHUNK *pDataChunks,
     int nChunks,
     PFN_WEBSOCKET_ASYNC_COMPLETION pfnCompletionCallback,
     IntPtr pvCompletionContext,
     out bool fCompletionExpected)
 {
     return(http_websockets_write_bytes(pInProcessHandler, pDataChunks, nChunks, pfnCompletionCallback, pvCompletionContext, out fCompletionExpected));
 }
Esempio n. 3
0
 private static extern unsafe int http_write_response_bytes(IntPtr pInProcessHandler, HttpApiTypes.HTTP_DATA_CHUNK *pDataChunks, int nChunks, out bool fCompletionExpected);
Esempio n. 4
0
 public static unsafe int HttpWriteResponseBytes(IntPtr pInProcessHandler, HttpApiTypes.HTTP_DATA_CHUNK *pDataChunks, int nChunks, out bool fCompletionExpected)
 {
     return(http_write_response_bytes(pInProcessHandler, pDataChunks, nChunks, out fCompletionExpected));
 }
Esempio n. 5
0
 protected override unsafe int WriteChunks(NativeSafeHandle requestHandler, int chunkCount, HttpApiTypes.HTTP_DATA_CHUNK *dataChunks,
                                           out bool completionExpected)
 {
     return(NativeMethods.HttpWriteResponseBytes(requestHandler, dataChunks, chunkCount, out completionExpected));
 }
Esempio n. 6
0
 internal unsafe static extern int http_write_response_bytes(IntPtr pHttpContext, HttpApiTypes.HTTP_DATA_CHUNK *pDataChunks, int nChunks, PFN_ASYNC_COMPLETION pfnCompletionCallback, IntPtr pvCompletionContext, out bool fCompletionExpected);
 protected override unsafe int WriteChunks(NativeSafeHandle requestHandler, int chunkCount, HttpApiTypes.HTTP_DATA_CHUNK *dataChunks, out bool completionExpected)
 {
     _thisHandle = GCHandle.Alloc(this);
     return(NativeMethods.HttpWebsocketsWriteBytes(requestHandler, dataChunks, chunkCount, &WriteCallback, (IntPtr)_thisHandle, out completionExpected));
 }
    private unsafe int WriteSequence(NativeSafeHandle requestHandler, int nChunks, ReadOnlySequence <byte> buffer, HttpApiTypes.HTTP_DATA_CHUNK *pDataChunks, out bool fCompletionExpected)
    {
        var currentChunk = 0;

        if (_handles == null || _handles.Length < nChunks)
        {
            _handles = new MemoryHandle[nChunks];
        }

        foreach (var readOnlyMemory in buffer)
        {
            ref var handle = ref _handles[currentChunk];
            ref var chunk  = ref pDataChunks[currentChunk];