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
ConnectorSettingsThe settings for the socket client.
Properties
Settings
The settings for the socket client.
public ConnectorSettings Settings { get; set; }
Property Value
Methods
Connect()
Connect to the socket server
public Task Connect()
Returns
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
stringThe token to set
Events
OnConnectionChange
The event that is raised when the socket connection is changed.
public event EventHandler<ESocketState> OnConnectionChange
Event Type
OnError
The event that is raised when the client receives errors.
public event EventHandler<Exception> OnError
Event Type
OnPlaylistCreated
The event that is raised when a playlist was created
public event EventHandler<PlaylistOutput> OnPlaylistCreated
Event Type
OnPlaylistDeleted
The event that is raised when a playlist was deleted
public event EventHandler<string> OnPlaylistDeleted
Event Type
OnStateChange
The event that is raised when the YTMDesktop State has changed.
public event EventHandler<StateOutput> OnStateChange