1
0
mirror of https://github.com/ZetaKebab/MpcNET.git synced 2025-01-14 22:18:43 +00:00
MpcNET/Sources/MpcNET/IMpcConnection.cs

48 lines
1.6 KiB
C#
Raw Normal View History

2018-03-02 11:14:26 +00:00
// --------------------------------------------------------------------------------------------------------------------
2018-05-18 13:14:20 +00:00
// <copyright file="IMpcConnection.cs" company="MpcNET">
// Copyright (c) MpcNET. All rights reserved.
2018-03-02 11:14:26 +00:00
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
// </copyright>
// --------------------------------------------------------------------------------------------------------------------
namespace MpcNET
{
using System;
2021-10-03 15:53:58 +00:00
using System.Threading;
2018-03-02 11:14:26 +00:00
using System.Threading.Tasks;
using MpcNET.Message;
/// <summary>
/// Interface for implementing an MPD connection.
/// </summary>
/// <seealso cref="System.IDisposable" />
public interface IMpcConnection : IDisposable
{
/// <summary>
/// Gets the version.
/// </summary>
string Version { get; }
/// <summary>
/// Connects asynchronously.
/// </summary>
/// <returns>The connect task.</returns>
2021-10-03 15:53:58 +00:00
Task ConnectAsync(CancellationToken token);
2018-03-02 11:14:26 +00:00
/// <summary>
/// Disconnects asynchronously.
/// </summary>
/// <returns>The disconnect task.</returns>
Task DisconnectAsync();
/// <summary>
/// Sends the command asynchronously.
/// </summary>
/// <typeparam name="TResponse">The response type.</typeparam>
2018-09-04 17:45:21 +00:00
/// <param name="mpcCommand">The command selector.</param>
/// <returns>
/// The send task.
/// </returns>
Task<IMpdMessage<TResponse>> SendAsync<TResponse>(IMpcCommand<TResponse> mpcCommand);
2018-03-02 11:14:26 +00:00
}
}