gen_tcp:listen doesn't allow overwriting tcp_backend if `:inet` is passed
Describe the bug
If the inet option is passed as an option before {tcp_module, my_module}, then gen_tcp:listen does not respect the tcp_module overwrite given.
To Reproduce
gen_tcp:listen(0, [{fd, Listener}, inet, {tcp_module, my_module}])
Expected behavior
my_module is used as the backend for the listener.
Affected versions
Erlang/OTP 27
Additional context
Moving the inet option behind the tcp_module option is a workaround.
If you do not specify a module, the selected module is family specific (inet_tcp for 'inet', inet6_tcp for 'inet6' and so on). I am guessing here, but its possible that the designers thought that if you specify the family before the tcp-module, family takes precedence (but then, why would you specify the tcp-module at all?). But if so, this should have been made clear in the documentation.
A solution for this has been merged into master and will be released with 29.0 The reason for waiting until 29, is to avoid a potential backward compatibility issue in maintenance releases.
Thank you!