Class PassthroughPacketTransport
- Namespace
- VpnHood.Net.PacketTransports
- Assembly
- VpnHood.Net.PacketTransports.dll
Provides a packet transport with no queue: each packet is handed on at once, on the sender's thread, through SendPacket(IpPacket).
public abstract class PassthroughPacketTransport : PacketTransportBase, IPacketTransport, IDisposable
- Inheritance
-
PassthroughPacketTransport
- Implements
- Derived
- Inherited Members
Remarks
It never disposes a packet it hands on; one SendPacket(IpPacket) fails on is disposed.
Constructors
PassthroughPacketTransport()
Provides a packet transport with no queue: each packet is handed on at once, on the sender's thread, through SendPacket(IpPacket).
protected PassthroughPacketTransport()
Remarks
It never disposes a packet it hands on; one SendPacket(IpPacket) fails on is disposed.
Methods
SendPacket(IpPacket)
Hands one packet on, at once. Once handed on, the packet is no longer this transport's; throw only before.
protected abstract void SendPacket(IpPacket ipPacket)
Parameters
ipPacketIpPacketThe packet.
SendPacketsAsync(IReadOnlyList<IpPacket>)
Hands the batch's one packet to SendPacket(IpPacket), and disposes it when that throws.
protected override sealed ValueTask SendPacketsAsync(IReadOnlyList<IpPacket> ipPackets)
Parameters
ipPacketsIReadOnlyList<IpPacket>The batch: empty, or one packet.
Returns
- ValueTask
A completed task.
Exceptions
- ArgumentOutOfRangeException
The batch holds more than one packet.