1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 13:37:25 +08:00

Rename Socket* -> PersistentEndpoint*

This commit is contained in:
Dan Balasescu 2022-11-02 11:43:22 +09:00
parent 8a37649097
commit 46d1713e28
4 changed files with 9 additions and 9 deletions

View File

@ -7,7 +7,7 @@ using Microsoft.AspNetCore.SignalR.Client;
namespace osu.Game.Online
{
public class HubClient : SocketClient
public class HubClient : PersistentEndpointClient
{
public readonly HubConnection Connection;

View File

@ -14,7 +14,7 @@ using osu.Game.Online.API;
namespace osu.Game.Online
{
public class HubClientConnector : SocketClientConnector, IHubClientConnector
public class HubClientConnector : PersistentEndpointClientConnector, IHubClientConnector
{
public const string SERVER_SHUTDOWN_MESSAGE = "Server is shutting down.";
@ -51,7 +51,7 @@ namespace osu.Game.Online
this.preferMessagePack = preferMessagePack;
}
protected override Task<SocketClient> BuildConnectionAsync(CancellationToken cancellationToken)
protected override Task<PersistentEndpointClient> BuildConnectionAsync(CancellationToken cancellationToken)
{
var builder = new HubConnectionBuilder()
.WithUrl(endpoint, options =>
@ -91,7 +91,7 @@ namespace osu.Game.Online
ConfigureConnection?.Invoke(newConnection);
return Task.FromResult((SocketClient)new HubClient(newConnection));
return Task.FromResult((PersistentEndpointClient)new HubClient(newConnection));
}
protected override string ClientName { get; }

View File

@ -7,7 +7,7 @@ using System.Threading.Tasks;
namespace osu.Game.Online
{
public abstract class SocketClient : IAsyncDisposable
public abstract class PersistentEndpointClient : IAsyncDisposable
{
public event Func<Exception?, Task>? Closed;

View File

@ -12,7 +12,7 @@ using osu.Game.Online.API;
namespace osu.Game.Online
{
public abstract class SocketClientConnector : Component
public abstract class PersistentEndpointClientConnector : Component
{
/// <summary>
/// Whether this is connected to the hub, use <see cref="CurrentConnection"/> to access the connection, if this is <c>true</c>.
@ -22,7 +22,7 @@ namespace osu.Game.Online
/// <summary>
/// The current connection opened by this connector.
/// </summary>
public SocketClient? CurrentConnection { get; private set; }
public PersistentEndpointClient? CurrentConnection { get; private set; }
private readonly Bindable<bool> isConnected = new Bindable<bool>();
private readonly SemaphoreSlim connectionLock = new SemaphoreSlim(1);
@ -34,7 +34,7 @@ namespace osu.Game.Online
/// Constructs a new <see cref="HubClientConnector"/>.
/// </summary>
/// <param name="api"> An API provider used to react to connection state changes.</param>
protected SocketClientConnector(IAPIProvider api)
protected PersistentEndpointClientConnector(IAPIProvider api)
{
apiState.BindTo(api.State);
apiState.BindValueChanged(_ => Task.Run(connectIfPossible), true);
@ -124,7 +124,7 @@ namespace osu.Game.Online
await Task.Delay(5000, cancellationToken).ConfigureAwait(false);
}
protected abstract Task<SocketClient> BuildConnectionAsync(CancellationToken cancellationToken);
protected abstract Task<PersistentEndpointClient> BuildConnectionAsync(CancellationToken cancellationToken);
private async Task onConnectionClosed(Exception? ex, CancellationToken cancellationToken)
{