`
This commit is contained in:
parent
2b28969d27
commit
e43ea79f91
@ -256,25 +256,25 @@ namespace XNet.Business
|
||||
}
|
||||
}
|
||||
|
||||
private async Task SendToSingleConnAsync(WebSocket socket, byte[] data, string connId, List<string> deadConnIds)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (socket.State == WebSocketState.Open)
|
||||
{
|
||||
await socket.SendAsync(new ArraySegment<byte>(data), WebSocketMessageType.Binary, true, CancellationToken.None);
|
||||
}
|
||||
else
|
||||
{
|
||||
deadConnIds.Add(connId);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"[WS .NET 10] 发送失败 {connId}:{ex.Message}");
|
||||
deadConnIds.Add(connId);
|
||||
}
|
||||
}
|
||||
//private async Task SendToSingleConnAsync(WebSocket socket, byte[] data, string connId, List<string> deadConnIds)
|
||||
//{
|
||||
// try
|
||||
// {
|
||||
// if (socket.State == WebSocketState.Open)
|
||||
// {
|
||||
// await socket.SendAsync(new ArraySegment<byte>(data), WebSocketMessageType.Binary, true, CancellationToken.None);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// deadConnIds.Add(connId);
|
||||
// }
|
||||
// }
|
||||
// catch (Exception ex)
|
||||
// {
|
||||
// Console.WriteLine($"[WS .NET 10] 发送失败 {connId}:{ex.Message}");
|
||||
// deadConnIds.Add(connId);
|
||||
// }
|
||||
//}
|
||||
|
||||
public async ValueTask DisposeAsync()
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user