Table of Contents

Class EchoHubConnection

Namespace
EchoHub.Client.Services
Assembly
EchoHub.Client.dll
public sealed class EchoHubConnection : IAsyncDisposable
Inheritance
EchoHubConnection
Implements
Inherited Members

Constructors

EchoHubConnection(string, ApiClient)

public EchoHubConnection(string serverUrl, ApiClient apiClient)

Parameters

serverUrl string
apiClient ApiClient

Properties

IsConnected

public bool IsConnected { get; }

Property Value

bool

Methods

ConnectAsync()

public Task ConnectAsync()

Returns

Task

DisconnectAsync()

public Task DisconnectAsync()

Returns

Task

DisposeAsync()

public ValueTask DisposeAsync()

Returns

ValueTask

GetHistoryAsync(string, int)

public Task<List<MessageDto>> GetHistoryAsync(string channelName, int count = 50)

Parameters

channelName string
count int

Returns

Task<List<MessageDto>>

GetOnlineUsersAsync(string)

public Task<List<UserPresenceDto>> GetOnlineUsersAsync(string channelName)

Parameters

channelName string

Returns

Task<List<UserPresenceDto>>

JoinChannelAsync(string)

public Task<List<MessageDto>> JoinChannelAsync(string channelName)

Parameters

channelName string

Returns

Task<List<MessageDto>>

LeaveChannelAsync(string)

public Task LeaveChannelAsync(string channelName)

Parameters

channelName string

Returns

Task

SendMessageAsync(string, string)

public Task SendMessageAsync(string channelName, string content)

Parameters

channelName string
content string

Returns

Task

UpdateStatusAsync(UserStatus, string?)

public Task UpdateStatusAsync(UserStatus status, string? statusMessage = null)

Parameters

status UserStatus
statusMessage string

Returns

Task

Events

OnChannelUpdated

public event Action<ChannelDto>? OnChannelUpdated

Event Type

Action<ChannelDto>

OnConnectionStateChanged

public event Action<string>? OnConnectionStateChanged

Event Type

Action<string>

OnError

public event Action<string>? OnError

Event Type

Action<string>

OnMessageReceived

public event Action<MessageDto>? OnMessageReceived

Event Type

Action<MessageDto>

OnReconnected

public event Action? OnReconnected

Event Type

Action

OnUserJoined

public event Action<string, string>? OnUserJoined

Event Type

Action<string, string>

OnUserLeft

public event Action<string, string>? OnUserLeft

Event Type

Action<string, string>

OnUserStatusChanged

public event Action<UserPresenceDto>? OnUserStatusChanged

Event Type

Action<UserPresenceDto>