forked from microsoft/msquic
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Callback Helpers to .NET Interop Layer (microsoft#2719)
- Loading branch information
1 parent
428aa22
commit 9f7e323
Showing
1 changed file
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#pragma warning disable IDE0073 | ||
// | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
// | ||
#pragma warning restore IDE0073 | ||
|
||
using System; | ||
|
||
namespace Microsoft.Quic | ||
{ | ||
internal unsafe static class MsQuicExtensions | ||
{ | ||
public static void SetConnectionCallback(this ref QUIC_API_TABLE Table, QUIC_HANDLE* Handle, delegate* unmanaged[Cdecl]<QUIC_HANDLE*, void*, QUIC_CONNECTION_EVENT*, int> Callback, void* Context) | ||
{ | ||
Table.SetCallbackHandler(Handle, Callback, Context); | ||
} | ||
|
||
public static void SetStreamCallback(this ref QUIC_API_TABLE Table, QUIC_HANDLE* Handle, delegate* unmanaged[Cdecl]<QUIC_HANDLE*, void*, QUIC_STREAM_EVENT*, int> Callback, void* Context) | ||
{ | ||
Table.SetCallbackHandler(Handle, Callback, Context); | ||
} | ||
|
||
public static void SetListenerCallback(this ref QUIC_API_TABLE Table, QUIC_HANDLE* Handle, delegate* unmanaged[Cdecl]<QUIC_HANDLE*, void*, QUIC_LISTENER_EVENT*, int> Callback, void* Context) | ||
{ | ||
Table.SetCallbackHandler(Handle, Callback, Context); | ||
} | ||
} | ||
} |