emqx / esockd

Erlang general non-blocking TCP/SSL socket server
https://www.emqx.com
Apache License 2.0
212 stars 84 forks source link

fix(setopts): pass only changed socket options to `setops/2` #184

Closed keynslug closed 10 months ago

keynslug commented 10 months ago

Some listening socket options can not be changed after the socket has been bound (e.g. backlog). Before this PR, an attempt to change them is made (i.e. during the call esockd:set_options/2) if they were set once during listener setup but haven't changed since then.

Also, pull socket-related options for DTLS listener from udp_options property. This ensures that they are not getting into ssl:handshake/3 later on as before, when they had to be part of dtls_options property.

Also, turn MFA from argument into an option, and accommodate APIs for that. Make it possible to change it at runtime with the help of esockd:setopts/2.

Part of EMQX-11527. Part of EMQX-11528.