From 9c4595e9ffbace01342ec481f6637a01765321d3 Mon Sep 17 00:00:00 2001 From: William Yang Date: Mon, 20 Nov 2023 14:55:55 +0100 Subject: [PATCH] fix: listener handle port close --- src/esockd_listener.erl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/esockd_listener.erl b/src/esockd_listener.erl index 60f1ec38..4e6ff53a 100644 --- a/src/esockd_listener.erl +++ b/src/esockd_listener.erl @@ -117,6 +117,9 @@ handle_cast(Msg, State) -> error_logger:error_msg("[~s] Unexpected cast: ~p", [?MODULE, Msg]), {noreply, State}. +handle_info({'EXIT', LSock, _}, #state{lsock = LSock} = State) -> + error_logger:error_msg("~s Lsocket ~p closed", [?MODULE, LSock]), + {stop, lsock_closed, State}; handle_info(Info, State) -> error_logger:error_msg("[~s] Unexpected info: ~p", [?MODULE, Info]), {noreply, State}.