~ruther/NosTale-PacketLogger

ref: bdbc0d948a7d9e019c03eea91adb7250f4fdc078 NosTale-PacketLogger/src/PacketLogger/Models/Packets/IPacketSender.cs -rw-r--r-- 1.2 KiB
bdbc0d94 — Rutherther feat: add injection and named pipes connection support 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
31
32
33
34
//
//  IPacketSender.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.Threading;
using System.Threading.Tasks;
using Avalonia.Controls;
using Remora.Results;

namespace PacketLogger.Models.Packets;

/// <summary>
/// A provider that may as well send or receive packets.
/// </summary>
public interface IPacketSender : IPacketProvider
{
    /// <summary>
    /// Send the given packets.
    /// </summary>
    /// <param name="packetString">The packet to send.</param>
    /// <param name="ct">The cancellation token used for cancelling the operation.</param>
    /// <returns>A result that may or may not have succeeded.</returns>
    Task<Result> SendPacket(string packetString, CancellationToken ct = default);

    /// <summary>
    /// Receive the given packet.
    /// </summary>
    /// <param name="packetString">The packet to send.</param>
    /// <param name="ct">The cancellation token used for cancelling the operation.</param>
    /// <returns>A result that may or may not have succeeded.</returns>
    Task<Result> ReceivePacket(string packetString, CancellationToken ct = default);
}
Do not follow this link