Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maximum tcp client connection number does not increase. (IDFGH-2840) #4900

Closed
TarikAkyuz opened this issue Mar 6, 2020 · 3 comments
Closed

Comments

@TarikAkyuz
Copy link

A tcp server is established in Esp32(station mode).
I accept the clients with the code below.

        int sock = accept(listen_sock, (struct sockaddr *)&source_addr, &addr_len);
        if (sock < 0) {
            ESP_LOGE(TAG, "Unable to accept connection: errno %d", errno);
            break;
        }

When 20 tcp clients send requests to connect at the same time, 9 can connect. But in my system, 1000 clients on the field will have to connect to the esp32 server at the same time.

Although I made "Maximum active TCP Connections" and "Maximum listening TCP Connections" 1000 in Menuconfig(LWIP->TCP), the number of connections did not change.

Only when I changed the "Max number of open sockets" in menuconfig, I was able to increase the number of connections.

Esp32 will be connected to the network in "station" mode and create tcp server. The other 1000 esp32 will connect to this as client.

Is it possible?How should I set tcp server, if possible?

@github-actions github-actions bot changed the title Maximum tcp client connection number does not increase. Maximum tcp client connection number does not increase. (IDFGH-2840) Mar 6, 2020
@freakyxue
Copy link
Collaborator

hi @TarikAkyuz
Do you want to establish a 1000 socket connection on a device?
In menuconfig ,The upper limit of socket is 16.
because sockets take up a certain amount of memory, and allowing fewer
sockets to be open at the same time conserves memory. Specify
the maximum amount of sockets here. The valid value is from 1 to 16.

@freakyxue
Copy link
Collaborator

hi @TarikAkyuz
Do you have any questions about this problem? I will close this problem. If yes, please reopen it

@Alvin1Zhang
Copy link
Collaborator

@TarikAkyuz Thanks for reporting. Will close due to short of feedback, feel free to reopen if any more updates. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants