summaryrefslogtreecommitdiffstats
path: root/src/main.c
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2020-07-30 14:13:55 +0200
committerGravatar Nikias Bassen2020-07-30 14:13:55 +0200
commitd39172b9b35230060da85cf03548d3e516a736c4 (patch)
tree70fcc21aa7487b9eec68c514710ec1d5d7850ee5 /src/main.c
parente2cd81c05f26fa243be4acf316d2e8766427f2ce (diff)
downloadusbmuxd-d39172b9b35230060da85cf03548d3e516a736c4.tar.gz
usbmuxd-d39172b9b35230060da85cf03548d3e516a736c4.tar.bz2
main: Increase listen socket backlog size
In environments with a larger number of devices, especially when these are connected at the time usbmuxd starts, there will be a lot of simultaneous connection attemps. With a backlog size of 5 these connection attempts will easily get a ECONNREFUSED thus failing to perform the required preflight operations. Increasing this to 256 will help to mitigate this.
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c
index b935e80..28ca65a 100644
--- a/src/main.c
+++ b/src/main.c
@@ -105,7 +105,7 @@ static int create_socket(void) {
}
// Start listening
- if (listen(listenfd, 5) != 0) {
+ if (listen(listenfd, 256) != 0) {
usbmuxd_log(LL_FATAL, "listen() failed: %s", strerror(errno));
return -1;
}