mirror of
https://github.com/cemu-project/DS4Windows.git
synced 2024-11-23 09:49:16 +01:00
Use SendToAsync and uncheck to improve UDP server performance
This commit is contained in:
parent
24403394ad
commit
4c70b7a8f0
@ -413,6 +413,8 @@ namespace DS4Windows
|
||||
}
|
||||
|
||||
private bool ReportToBuffer(DS4State hidReport, byte[] outputData, ref int outIdx)
|
||||
{
|
||||
unchecked
|
||||
{
|
||||
outputData[outIdx] = 0;
|
||||
|
||||
@ -522,6 +524,7 @@ namespace DS4Windows
|
||||
Array.Clear(outputData, outIdx, 12);
|
||||
outIdx += 12;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -621,7 +624,11 @@ namespace DS4Windows
|
||||
|
||||
foreach (var cl in clientsList)
|
||||
{
|
||||
try { udpSock.SendTo(outputData, cl); }
|
||||
//try { udpSock.SendTo(outputData, cl); }
|
||||
SocketAsyncEventArgs args = new SocketAsyncEventArgs();
|
||||
args.RemoteEndPoint = cl;
|
||||
args.SetBuffer(outputData, 0, outputData.Length);
|
||||
try { udpSock.SendToAsync(args); }
|
||||
catch (SocketException ex) { }
|
||||
}
|
||||
clientsList.Clear();
|
||||
|
Loading…
Reference in New Issue
Block a user