Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve transfer speed (sending) #178

Merged
merged 11 commits into from
Jul 30, 2024
Prev Previous commit
Next Next commit
Use TcpClient.NoDelay
  • Loading branch information
ShortDevelopment committed Jul 30, 2024
commit 5c7e18e3ad7abc2f70f2b58069eb492275a9bd3c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public async Task Listen(CancellationToken cancellationToken)
if (client.Client.RemoteEndPoint is not IPEndPoint endPoint)
return;

client.NoDelay = true;
var stream = client.GetStream();
DeviceConnected?.Invoke(this, new()
{
Expand All @@ -52,6 +53,7 @@ public async Task<CdpSocket> ConnectAsync(EndpointInfo endpoint)
// ToDo: If the windows machine tries to connect back it uses the port assigned here not 5040!!
TcpClient client = new();
await client.ConnectAsync(endpoint.ToIPEndPoint()).ConfigureAwait(false);
client.NoDelay = true;
return new()
{
Endpoint = endpoint,
Expand Down