using System.Threading.Channels;
using ModelContextProtocol.Protocol.Messages;
namespace ModelContextProtocol.Protocol.Transport;
///
/// Represents a transport mechanism for MCP communication.
///
public interface ITransport : IAsyncDisposable
{
///
/// Gets whether the transport is currently connected.
///
bool IsConnected { get; }
///
/// Channel for receiving messages from the transport.
///
ChannelReader MessageReader { get; }
///
/// Sends a message through the transport.
///
/// The message to send.
/// The to monitor for cancellation requests. The default is .
Task SendMessageAsync(IJsonRpcMessage message, CancellationToken cancellationToken = default);
}