Browse Source

Increase listen backlog to speed up reconnects up to the system config limits

master
Con Kolivas 10 years ago
parent
commit
7c62450297
  1. 6
      src/connector.c

6
src/connector.c

@ -919,7 +919,9 @@ int connector(proc_instance_t *pi)
Close(sockd);
goto out;
}
if (listen(sockd, SOMAXCONN) < 0) {
/* Set listen backlog to larger than SOMAXCONN in case the
* system configuration supports it */
if (listen(sockd, 1024) < 0) {
LOGERR("Connector failed to listen on socket");
Close(sockd);
goto out;
@ -961,7 +963,7 @@ int connector(proc_instance_t *pi)
ret = 1;
goto out;
}
if (listen(sockd, SOMAXCONN) < 0) {
if (listen(sockd, 1024) < 0) {
LOGERR("Connector failed to listen on socket");
Close(sockd);
goto out;

Loading…
Cancel
Save