[Spice-devel] [PATCH spice] reds: increase listening socket backlog
Christophe Fergeau
cfergeau at redhat.com
Mon Feb 16 02:34:56 PST 2015
Hey,
On Wed, Jan 21, 2015 at 04:46:07PM +0100, Marc-André Lureau wrote:
> With TCP socket, the backlog doesn't seem to be such an important value,
> perhaps because of latency or underlying protocol behaviour. However,
> on UNIX socket, it is fairly easy to reach the backlog limit and the
> client will get an EAGAIN error (not ECONNREFUSED as stated in
> listen(7)) that is not easy to deal with: attempting to reconnect in a
> loop might busy-loop forever as there are no guarantee the server will
> accept new connections, so it will be inherently racy.
>
> Typically, Spice server can easily have up to 15 concurrent incoming
> connections that are established during initialization of the session,
> so let's raise the backlog limit to the default system value, which is
> 128 on Linux to avoid any guesses.
128 is the default _maximum_ system value, ACK with that fixed.
Christophe
> ---
> server/reds.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/server/reds.c b/server/reds.c
> index b9030c0..b4053f5 100644
> --- a/server/reds.c
> +++ b/server/reds.c
> @@ -2424,7 +2424,7 @@ static int reds_init_socket(const char *addr, int portnr, int family)
> return -1;
>
> listen:
> - if (listen(slisten,1) != 0) {
> + if (listen(slisten, SOMAXCONN) != 0) {
> spice_warning("listen: %s", strerror(errno));
> close(slisten);
> return -1;
> --
> 2.1.0
>
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20150216/d9aae58a/attachment.sig>
More information about the Spice-devel
mailing list