wanshenmean
2026-03-17 94ad631d316da04c46266ddb1fc6e63e6f8f2fae
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
using System.Net.Sockets;
using WIDESEAWCS_QuartzJob;
using WIDESEAWCS_Tasks.Workflow.Abstractions;
 
namespace WIDESEAWCS_Tasks.SocketServer
{
    /// <summary>
    /// TcpSocketServer µÄÊÊÅäÆ÷ʵÏÖ£¬±£³Öµ×²ãÐÐΪ²»±ä£¬½ö×ö·ÃÎÊÊÕ¿Ú¡£
    /// </summary>
    public class SocketClientGateway : ISocketClientGateway
    {
        private readonly TcpSocketServer _tcpSocket;
 
        public SocketClientGateway(TcpSocketServer tcpSocket)
        {
            _tcpSocket = tcpSocket;
        }
 
        public Task<bool> SendToClientAsync(string clientId, string message)
        {
            return _tcpSocket.SendToClientAsync(clientId, message);
        }
 
        public Task SendMessageAsync(TcpClient client, string message)
        {
            return _tcpSocket.SendMessageAsync(client, message);
        }
 
        public IReadOnlyList<string> GetClientIds()
        {
            return _tcpSocket.GetClientIds();
        }
 
        public Task HandleClientAsync(TcpClient client, string clientId, CancellationToken cancellationToken, RobotSocketState robotCrane)
        {
            return _tcpSocket.HandleClientAsync(client, clientId, cancellationToken, robotCrane);
        }
    }
}