Bewerken

Delen via


QuicConnection Class

Definition

Represents a QUIC connection, which doesn't send or receive data itself but rather allows opening or accepting multiple streams.

public ref class QuicConnection sealed : IAsyncDisposable
public sealed class QuicConnection : IAsyncDisposable
type QuicConnection = class
    interface IAsyncDisposable
Public NotInheritable Class QuicConnection
Implements IAsyncDisposable
Inheritance
QuicConnection
Implements

Remarks

A QuicConnection can either be accepted from AcceptConnectionAsync(CancellationToken) (inbound connection) or created with the static method ConnectAsync(QuicClientConnectionOptions, CancellationToken)(outbound connection).

Each connection can then open an outbound stream using OpenOutboundStreamAsync(QuicStreamType, CancellationToken) or accept an inbound stream using AcceptInboundStreamAsync(CancellationToken).

For QUIC prerequisites and supported operating systems, see Platform dependencies.

Properties

IsSupported

Gets a value that indicates whether QUIC is supported for client scenarios on the current machine.

LocalEndPoint

Gets the local endpoint used for this connection.

NegotiatedApplicationProtocol

Gets the final, negotiated application protocol.

RemoteCertificate

Gets the certificate provided by the peer.

RemoteEndPoint

Gets the remote endpoint used for this connection.

TargetHostName

Gets the name of the server the client is trying to connect to. That name is used for server certificate validation. It can be a DNS name or an IP address.

Methods

AcceptInboundStreamAsync(CancellationToken)

Accepts an inbound QuicStream.

CloseAsync(Int64, CancellationToken)

Closes the connection with the application provided-code.

ConnectAsync(QuicClientConnectionOptions, CancellationToken)

Creates a new QuicConnection and connects it to the peer.

DisposeAsync()

If not closed explicitly by CloseAsync(Int64, CancellationToken), closes the connection silently (leading to idle timeout on the peer side) and releases all resources associated with the connection.

Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
OpenOutboundStreamAsync(QuicStreamType, CancellationToken)

Creates an outbound unidirectional or bidirectional QuicStream.

ToString()

Returns a string that represents the current object.

Extension Methods

ConfigureAwait(IAsyncDisposable, Boolean)

Configures how awaits on the tasks returned from an async disposable will be performed.

Applies to

See also