private static unsafe int HandleEventNewStream(State state, ref QUIC_CONNECTION_EVENT connectionEvent) { var streamHandle = new SafeMsQuicStreamHandle(connectionEvent.PEER_STREAM_STARTED.Stream); if (!state.TryQueueNewStream(streamHandle, connectionEvent.PEER_STREAM_STARTED.Flags)) { // This will call StreamCloseDelegate and free the stream. // We will return Success to the MsQuic to prevent double free. streamHandle.Dispose(); } return(QUIC_STATUS_SUCCESS); }
private static uint HandleEventNewStream(State state, ref ConnectionEvent connectionEvent) { var streamHandle = new SafeMsQuicStreamHandle(connectionEvent.Data.PeerStreamStarted.Stream); if (!state.TryQueueNewStream(streamHandle, connectionEvent.Data.PeerStreamStarted.Flags)) { // This will call StreamCloseDelegate and free the stream. // We will return Success to the MsQuic to prevent double free. streamHandle.Dispose(); } return(MsQuicStatusCodes.Success); }
public void Cleanup() { ShutdownState = ShutdownState.Finished; CleanupSendState(this); Handle?.Dispose(); Marshal.FreeHGlobal(SendQuicBuffers); SendQuicBuffers = IntPtr.Zero; if (StateGCHandle.IsAllocated) { StateGCHandle.Free(); } ConnectionState?.RemoveStream(null); }