Skip to content

Reorder the uv_close() calls to close the socket immediately

Ondřej Surý requested to merge ondrej-netmgr-simplify-uv_close into main

Simplify the closing code - during the loopmgr implementation, it was discovered that the various lists used by the uv_loop_t aren't FIFO, but LIFO. With this knowledge, we can close the protocol handles (uv_udp_t and uv_tcp_t) and uv_timer_t at the same time by reordering the uv_close() calls, and thus making sure that after calling the isc__nm_stoplistening(), the code will not issue any additional callback calls (accept, read) on the socket that stopped listening.

See here for the additional context.

Edited by Artem Boldariev

Merge request reports