Initial commit
This commit is contained in:
commit
fdbd94b3f9
1 changed files with 2833 additions and 0 deletions
34
src/mcpdotnet/Protocol/Transport/IMcpTransport.cs
Normal file
34
src/mcpdotnet/Protocol/Transport/IMcpTransport.cs
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
// Protocol/Transport/IMcpTransport.cs
|
||||
namespace McpDotNet.Protocol.Transport;
|
||||
|
||||
using System.Threading.Channels;
|
||||
using global::McpDotNet.Protocol.Messages;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a transport mechanism for MCP communication.
|
||||
/// </summary>
|
||||
public interface IMcpTransport : IAsyncDisposable
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets whether the transport is currently connected.
|
||||
/// </summary>
|
||||
bool IsConnected { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Channel for receiving messages from the transport.
|
||||
/// </summary>
|
||||
ChannelReader<IJsonRpcMessage> MessageReader { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Establishes the transport connection.
|
||||
/// </summary>
|
||||
/// <param name="cancellationToken">Token to cancel the operation.</param>
|
||||
Task ConnectAsync(CancellationToken cancellationToken = default);
|
||||
|
||||
/// <summary>
|
||||
/// Sends a message through the transport.
|
||||
/// </summary>
|
||||
/// <param name="message">The message to send.</param>
|
||||
/// <param name="cancellationToken">Token to cancel the operation.</param>
|
||||
Task SendMessageAsync(IJsonRpcMessage message, CancellationToken cancellationToken = default);
|
||||
}
|
||||
Loading…
Reference in a new issue