Пример #1
0
        internal unsafe QuicConnection(IQuicInteropApi api, QuicSession session)
        {
            m_nativeApi = api;
            QuicHandle *handle = null;

            api.ConnectionOpen(session.m_handle, null, null, &handle);
            m_handle = handle;
        }
Пример #2
0
        internal unsafe QuicListener(IQuicInteropApi nativeApi, QuicSession session)
        {
            m_nativeApi = nativeApi;
            m_session   = session;

            connectionQueue = Channel.CreateBounded <QuicConnection>(new BoundedChannelOptions(128)
            {
                SingleWriter = true,
                SingleReader = true,
            });

            m_gcHandle = GCHandle.Alloc(this);

            QuicHandle *handle = null;

            m_nativeApi.ListenerOpen(session.m_handle, m_nativeListenerCallback, (void *)GCHandle.ToIntPtr(m_gcHandle), &handle);

            m_handle = handle;
        }