From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp63.i.mail.ru (smtp63.i.mail.ru [217.69.128.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 00EE5469710 for ; Wed, 6 May 2020 18:38:18 +0300 (MSK) Date: Wed, 6 May 2020 18:38:04 +0300 From: Alexander Turenko Message-ID: <20200506153804.5szcwvvl22eeeilr@tkn_work_nb> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Subject: Re: [Tarantool-patches] [PATCH] socket: fix error while closing socket.tcp_server List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Leonid Vasiliev Cc: tarantool-patches@dev.tarantool.org > @@ -1082,6 +1085,9 @@ local function tcp_server_loop(server, s, addr) > fiber.name(format("%s/%s:%s", server.name, addr.host, addr.port), {truncate = true}) > log.info("started") > while socket_readable(s) do > + if s._server_socket_closed then > + break > + end Can we use the same check `._gc_socket.fd >= 0` as in check_socket() (we can wrap it to a function like socket_is_closed())? It seems that using the same way for determining whether a socket is closed owuld simplify the code a bit. WBR, Alexander Turenko.