wanshenmean
2026-03-26 8e42d0c1b7ae36cff2e7c69999117911a4b6f300
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
using System.Net.Sockets;
 
namespace WIDESEAWCS_Tasks.Workflow.Abstractions
{
    /// <summary>
    /// 机器人消息路由接口 - 负责接收来自 TcpSocketServer 的消息并分发给合适的处理器
    /// </summary>
    public interface IRobotMessageRouter
    {
        /// <summary>
        /// 处理接收到的消息
        /// </summary>
        /// <param name="message">原始消息字符串</param>
        /// <param name="isJson">消息是否为 JSON 格式</param>
        /// <param name="client">TCP 客户端连接</param>
        /// <param name="state">机器人当前状态</param>
        /// <returns>响应消息,如果无需回复则返回 null</returns>
        Task<string?> HandleMessageReceivedAsync(string message, bool isJson, TcpClient client, RobotSocketState state);
    }
}