Skip to content

[API Proposal]: QuicError.AddressNotAvailable #76435

@pedrobsaila

Description

@pedrobsaila

Background and motivation

Some hosts cannot establish connection to specific addresses because Ipv6/Ipv4 are not enabled on them or more generally they don't support a specific address family. For example : when trying to establish a quic connection to an ipv6 address on a OS where ipv6 is disabled, we would get the following errors :

  • Unix : An internal error has occurred. Status code: Unknown (0x63)
  • Windows : An internal error has occurred. Status code: Unknown (0x80072743)

The goal of this proposal is to return a custom quic error for this case. The new enum would be mapped to :

  • Unix : EAFNOSUPPORT error
  • Windows : WSAENETUNREACH error

This proposal is created on behalf of this issue #74053

API Proposal

namespace System.Net.Quic;

public enum QuicError
    {
       /// <summary>
       /// The requested address is not available on this machine
       /// </summary>
       AddressNotAvailable,
    }

API Usage

try
{
// create quic connection
}
catch (QuicException ex)
{
      if (ex.QuicError == QuicError.AddressNotAvailable)
      {
              Console.WriteLine("The OS does not support this address family ")
      }
}

Alternative Designs

No response

Risks

No response

Metadata

Metadata

Assignees

Labels

api-needs-workAPI needs work before it is approved, it is NOT ready for implementationarea-System.Net.Quic

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions