Table of Contents

Interface IStreamConnection

Namespace
VpnHood.Core.Tunneling.Connections
Assembly
VpnHood.Core.Tunneling.dll

Represents a connection that carries one stream between a client and a server: a TCP connection, a QUIC stream, or one logical stream of a connection that carries many in turn.

public interface IStreamConnection : IDisposable, IAsyncDisposable
Inherited Members

Remarks

DisposeAsync() releases it: a reusable one ends its logical stream with the peer and goes back to its owner for another request, unless PreventReuse() came first, and any other closes. Dispose() is the quick close: the connection closes with no reuse, and nothing waits for its peer.

Properties

Connected

Gets a value indicating whether the connection is up.

bool Connected { get; }

Property Value

bool

ConnectionId

Gets or sets the connection's ID, which its logs carry.

string ConnectionId { get; set; }

Property Value

string

ConnectionName

Gets the connection's name, which its logs carry.

string ConnectionName { get; }

Property Value

string

IsServer

Gets a value indicating whether this is the server's side of the connection, which its logs show.

bool IsServer { get; }

Property Value

bool

LocalEndPoint

Gets the connection's local endpoint.

IPEndPoint LocalEndPoint { get; }

Property Value

IPEndPoint

RemoteEndPoint

Gets the peer's endpoint.

IPEndPoint RemoteEndPoint { get; }

Property Value

IPEndPoint

RequireHttpResponse

Gets or sets a value indicating whether an HTTP response to the connection's request header is still due before the request's own answer: the server writes it, and the client reads it.

bool RequireHttpResponse { get; set; }

Property Value

bool

Stream

Gets the stream the connection carries.

Stream Stream { get; }

Property Value

Stream

Methods

PreventReuse()

Makes the connection's release close it rather than keep it for another request.

void PreventReuse()

Remarks

A decorator passes it on, so it reaches the reusable connection however that is wrapped.