mirror of
https://github.com/Genymobile/scrcpy.git
synced 2025-12-19 06:24:19 +01:00
Enable TCP_NODELAY for the control socket
It is better to disable Nagle's algorithm to avoid unnecessary latency for control messages. (I'm not sure this has any impact for a local TCP socket though.)
This commit is contained in:
@@ -659,6 +659,14 @@ sc_server_connect_to(struct sc_server *server, struct sc_server_info *info) {
|
||||
}
|
||||
}
|
||||
|
||||
if (control_socket != SC_SOCKET_NONE) {
|
||||
// Disable Nagle's algorithm for the control socket
|
||||
// (it only impacts the sending side, so it is useless to set it
|
||||
// for the other sockets)
|
||||
bool ok = net_set_tcp_nodelay(control_socket, true);
|
||||
(void) ok; // error already logged
|
||||
}
|
||||
|
||||
// we don't need the adb tunnel anymore
|
||||
sc_adb_tunnel_close(tunnel, &server->intr, serial,
|
||||
server->device_socket_name);
|
||||
|
||||
Reference in New Issue
Block a user