fix(connection):stop listening after the server mode node stops

This commit is contained in:
hxy7yx
2023-11-30 16:56:54 +08:00
parent 038f8f77cf
commit 18bc31ef90
+3
View File
@@ -114,6 +114,9 @@ neu_conn_t *neu_conn_new(neu_conn_param_t *param, void *data,
void neu_conn_stop(neu_conn_t *conn)
{
pthread_mutex_lock(&conn->mtx);
if (conn->tcp_server.is_listen) {
conn_tcp_server_stop(conn);
}
conn->stop = true;
conn_disconnect(conn);
pthread_mutex_unlock(&conn->mtx);