From 46b82e865d08f13f08815ef8a2ec74f576615e11 Mon Sep 17 00:00:00 2001 From: Liu Dongmiao Date: Wed, 12 Jun 2024 15:05:02 +0800 Subject: [PATCH] both: remove reuse for client socket --- wss-client.c | 7 ------- wss-proxy-server.c | 4 ---- 2 files changed, 11 deletions(-) diff --git a/wss-client.c b/wss-client.c index b8ed48f..cb100ec 100644 --- a/wss-client.c +++ b/wss-client.c @@ -371,17 +371,10 @@ static int update_socket_flag(evutil_socket_t sock) { LOGW("cannot make socket nonblocking"); return 1; } - if (evutil_make_socket_closeonexec(sock) < 0) { LOGW("cannot make socket closeonexec"); return 1; } - - if (evutil_make_listen_socket_reuseable(sock) < 0) { - LOGW("cannot make socket reuseable"); - return 1; - } - return 0; } diff --git a/wss-proxy-server.c b/wss-proxy-server.c index d476257..afed6ab 100644 --- a/wss-proxy-server.c +++ b/wss-proxy-server.c @@ -168,10 +168,6 @@ static struct bufferevent *init_udp_client(struct event_base *base, struct raw_s LOGE("cannot make udp socket closeonexec"); goto error; } - if (evutil_make_listen_socket_reuseable(sock) < 0) { - LOGE("cannot make udp socket reuseable"); - goto error; - } bev_context_udp = calloc(1, sizeof(struct bev_context_udp)); if (bev_context_udp == NULL) { LOGE("cannot calloc for udp socket");