zephyrproject-rtos / zephyr

Primary Git Repository for the Zephyr Project. Zephyr is a new generation, scalable, optimized, secure RTOS for multiple hardware architectures.
https://docs.zephyrproject.org
Apache License 2.0
10.21k stars 6.26k forks source link

net: sockets: listen() ignores backlog parameter #10200

Open leodido99 opened 5 years ago

leodido99 commented 5 years ago

When calling listen on a socket you are supposed to provide the length of the pending connections backlog. In Zephyr this parameter is ignored when reaching net_context_listen.

Listen man entry specifies the behaviour as such: The backlog argument defines the maximum length to which the queue of pending connections for sockfd may grow. If a connection request arrives when the queue is full, the client may receive an error with an indication of ECONNREFUSED or, if the underlying protocol supports retransmission, the request may be ignored so that a later reattempt at connection succeeds.

Currently the behaviour seems to be largely driven by the value of CONFIG_NET_MAX_CONN.

pfalcon commented 5 years ago

@leodido99, ignoring backlog param, or handling it with "extended semantics" is a known pattern across TCP/IP stack implementations. Do you have a specific usecase behind this feature? Otherwise, this would be one of the lowest priorities feature request in the area of networking.

leodido99 commented 5 years ago

I don't really have any use case right now, was merely reporting this because it took me some time to find that I should use CONFIG_NET_MAX_CONN. I was more thinking of just having this written somewhere in the documentation maybe?

pfalcon commented 5 years ago

@leodido99 : Just to reply, sounds good. The docs for sockets definitely needs improvements, and this fact can be mentioned too. But it's likely going to be backlogged (at least) until 1.14 closing to the release freeze. Because so far, there're a lot of code work to do...

rljordan-zz commented 5 years ago

Is this a bug or an enhancement? Do we have an update on it?

zephyrbot commented 5 months ago

Hi @pfalcon,

This issue, marked as an Enhancement, was opened a while ago and did not get any traction. Please confirm the issue is correctly assigned and re-assign it otherwise.

Please take a moment to review if the issue is still relevant to the project. If it is, please provide feedback and direction on how to move forward. If it is not, has already been addressed, is a duplicate, or is no longer relevant, please close it with a short comment explaining the reason.

@leodido99 you are also encouraged to help moving this issue forward by providing additional information and confirming this request/issue is still relevant to you.

Thanks!