Exemplo n.º 1
0
 // TODO call this for graceful shutdown?
 public void ShutDown(
     QUIC_CONNECTION_SHUTDOWN_FLAG Flags,
     ushort ErrorCode)
 {
     MsQuicApi.Api.SessionShutdownDelegate(
         _nativeObjPtr,
         (uint)Flags,
         ErrorCode);
 }
Exemplo n.º 2
0
        public void Shutdown(
            QUIC_CONNECTION_SHUTDOWN_FLAG Flags,
            ushort ErrorCode)
        {
            var status = _api.ConnectionShutdownDelegate(
                _nativeObjPtr,
                (uint)Flags,
                ErrorCode);

            MsQuicStatusException.ThrowIfFailed(status);
        }
Exemplo n.º 3
0
        private ValueTask ShutdownAsync(
            QUIC_CONNECTION_SHUTDOWN_FLAG Flags,
            long ErrorCode)
        {
            uint status = MsQuicApi.Api.ConnectionShutdownDelegate(
                _ptr,
                (uint)Flags,
                ErrorCode);

            QuicExceptionHelpers.ThrowIfFailed(status, "Failed to shutdown connection.");

            return(new ValueTask(_shutdownTcs.Task));
        }
        private ValueTask ShutdownAsync(
            QUIC_CONNECTION_SHUTDOWN_FLAG Flags,
            long ErrorCode)
        {
            if (NetEventSource.IsEnabled)
            {
                NetEventSource.Enter(this);
            }

            uint status = MsQuicApi.Api.ConnectionShutdownDelegate(
                _ptr,
                (uint)Flags,
                ErrorCode);

            QuicExceptionHelpers.ThrowIfFailed(status, "Failed to shutdown connection.");

            if (NetEventSource.IsEnabled)
            {
                NetEventSource.Exit(this);
            }
            return(_shutdownTcs.GetTypelessValueTask());
        }