[Tarantool-patches] [PATCH] socket: fix error while closing socket.tcp_server

Alexander Turenko alexander.turenko at tarantool.org
Wed May 6 18:38:04 MSK 2020


> @@ -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 `<s>._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.


More information about the Tarantool-patches mailing list