~ruther/Nostale-Anonymizer

ref: e25d5a082b07dd6eedcacbcda31c23f40d1bf1a2 Nostale-Anonymizer/src/Anonymizer/Sinks/IPacketSource.cs -rw-r--r-- 909 bytes
e25d5a08 — František Boháček fix: bugs 2 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
//
//  IPacketSource.cs
//
//  Copyright (c) František Boháček. All rights reserved.
//  Licensed under the MIT license. See LICENSE file in the project root for full license information.

using System.Diagnostics.CodeAnalysis;

namespace Anonymizer.Sinks;

/// <summary>
/// An interface for receiving packets from an arbitrary source.
/// </summary>
public interface IPacketSource
{
    /// <summary>
    /// The current cursor position (current packet index).
    /// </summary>
    public long Cursor { get; }

    /// <summary>
    /// Tries to get next packet, if there is any.
    /// </summary>
    /// <remarks>
    /// Moves the cursor.
    /// </remarks>
    /// <param name="ct">The cancellation token used for cancelling the operation.</param>
    /// <returns>Null if no more packets are present.</returns>
    public Task<PacketInfo?> TryGetNextPacketAsync(CancellationToken ct = default);
}
Do not follow this link