Table of Contents

Class SocketClient

Namespace
XeroxDev.YTMDesktop.Companion.Clients
Assembly
XeroxDev.YTMDesktop.Companion.dll

The socket client for the YTMDesktop Companion

public class SocketClient : IGenericClient
Inheritance
SocketClient
Implements
Inherited Members

Constructors

SocketClient(ConnectorSettings)

The socket client for the YTMDesktop Companion

public SocketClient(ConnectorSettings settings)

Parameters

settings ConnectorSettings

The settings for the socket client.

Properties

Settings

The settings for the socket client.

public ConnectorSettings Settings { get; set; }

Property Value

ConnectorSettings

Methods

Connect()

Connect to the socket server

public Task Connect()

Returns

Task

GetClient()

Get the whole socket object. Use with caution!
Useful for custom things that are not implemented in the library yet.

public SocketIO GetClient()

Returns

SocketIO

The socket object

SetAuthToken(string)

Set the authentication token, so it can be used for further requests.
We recommend to use the SetAuthToken(string) method in the CompanionConnector class instead of this method because it also reconnects the socket client if the token changed.

public void SetAuthToken(string token)

Parameters

token string

The token to set

Events

OnConnectionChange

The event that is raised when the socket connection is changed.

public event EventHandler<ESocketState> OnConnectionChange

Event Type

EventHandler<ESocketState>

OnError

The event that is raised when the client receives errors.

public event EventHandler<Exception> OnError

Event Type

EventHandler<Exception>

OnPlaylistCreated

The event that is raised when a playlist was created

public event EventHandler<PlaylistOutput> OnPlaylistCreated

Event Type

EventHandler<PlaylistOutput>

OnPlaylistDeleted

The event that is raised when a playlist was deleted

public event EventHandler<string> OnPlaylistDeleted

Event Type

EventHandler<string>

OnStateChange

The event that is raised when the YTMDesktop State has changed.

public event EventHandler<StateOutput> OnStateChange

Event Type

EventHandler<StateOutput>