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);
|
}
|
}
|
}
|