Skip to content
Snippets Groups Projects
Commit b7c3772b authored by Martin Storsjö's avatar Martin Storsjö
Browse files

tcp: Try enabling SO_REUSEADDR when listening

parent 641f4a88
No related branches found
No related tags found
No related merge requests found
...@@ -83,6 +83,8 @@ static int tcp_open(URLContext *h, const char *uri, int flags) ...@@ -83,6 +83,8 @@ static int tcp_open(URLContext *h, const char *uri, int flags)
if (listen_socket) { if (listen_socket) {
int fd1; int fd1;
int reuse = 1;
setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &reuse, sizeof(reuse));
ret = bind(fd, cur_ai->ai_addr, cur_ai->ai_addrlen); ret = bind(fd, cur_ai->ai_addr, cur_ai->ai_addrlen);
if (ret) { if (ret) {
ret = ff_neterrno(); ret = ff_neterrno();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment