Interface ILink
Namespace: Void.Proxy.Api.Links
Assembly: Void.Proxy.Api.dll
Represents an active bidirectional forwarding session between a player and a backend Minecraft server.
public interface ILink : IEventListener, IAsyncDisposableImplements
IEventListener, IAsyncDisposable
Extension Methods
LinkExtensions.SendPacketAsync<T>(ILink, CancellationToken), LinkExtensions.SendPacketAsync<T>(ILink, T, CancellationToken), LinkExtensions.SendPacketAsync<T>(ILink, Side, T, CancellationToken)
Remarks
A link owns two
Properties
Channels
Gets an enumerable containing both
IEnumerable<INetworkChannel> Channels { get; }Property Value
IsAlive
Gets a value indicating whether both forwarding tasks are still running.
bool IsAlive { get; }Property Value
Player
Gets the player whose client connection is being proxied through this link.
IPlayer Player { get; }Property Value
PlayerChannel
Gets the network channel that faces the player’s client.
INetworkChannel PlayerChannel { get; }Property Value
Server
Gets the backend server that the player is currently connected to through this link.
IServer Server { get; }Property Value
ServerChannel
Gets the network channel that faces the backend server.
INetworkChannel ServerChannel { get; }Property Value
Methods
StartAsync(CancellationToken)
Starts the bidirectional forwarding loops that relay network messages between the player and the server.
ValueTask StartAsync(CancellationToken cancellationToken)Parameters
cancellationToken CancellationToken
A token that can be used to cancel the start operation.
Returns
Exceptions
Thrown when the link has already been started.
StopAsync(CancellationToken)
Requests an orderly shutdown of both forwarding loops and waits for them to drain.
ValueTask StopAsync(CancellationToken cancellationToken)Parameters
cancellationToken CancellationToken
A token that can be used to cancel the stop operation.
Returns
Exceptions
Thrown when the link has not been started yet.