Class PacketTransportOptions
- Namespace
- VpnHood.Net.PacketTransports
- Assembly
- VpnHood.Net.PacketTransports.dll
Provides the settings of a packet transport's send queue.
public class PacketTransportOptions
- Inheritance
-
PacketTransportOptions
- Inherited Members
Fields
DefaultQueueCapacity
The queue's capacity when QueueCapacity is not set: 255 packets.
public const int DefaultQueueCapacity = 255
Field Value
Properties
AutoDisposePackets
Gets a value indicating whether the transport disposes each packet once sent. Set it to false for a transport that hands its packets on, whose new owner disposes them.
public required bool AutoDisposePackets { get; init; }
Property Value
Remarks
A packet the transport drops or refuses, it disposes either way; one a send fails on too, except in a passthrough transport without this option, whose derived class disposes it.
Blocking
Gets a value indicating whether a send to a full queue waits for room, up to BlockingTimeout. When false, a full queue drops its oldest packet instead.
public required bool Blocking { get; init; }
Property Value
Remarks
A waiting SendPacketQueued(IpPacket) holds its thread; the async send waits without one, holding its packet outside the queue. Disposing the transport releases the waits. Never send from the transport's own send method, which the queue waits on: that send would wait out the timeout, or forever without one.
BlockingTimeout
Gets how long a blocking send waits for room before it drops its packet, or null to wait until there is room or the transport is disposed.
public TimeSpan? BlockingTimeout { get; init; }
Property Value
QueueCapacity
Gets the number of packets the send queue holds, or null for DefaultQueueCapacity.
public int? QueueCapacity { get; init; }
Property Value
- int?