private unsafe static int StaticHandler(QuicHandle *handle, void *context, QuicNativeConnectionEvent *evnt) { var managedHandle = GCHandle.FromIntPtr((IntPtr)context); var connection = (QuicConnection)managedHandle.Target; return(connection.Handler(evnt)); }
private unsafe int Handler(QuicNativeConnectionEvent *evnt) { GC.KeepAlive(m_nativeApi); void *v = (void *)evnt; return(0); }