api7 / lua-resty-ldap

Apache License 2.0
7 stars 6 forks source link

feat: reuse tcp socket #10

Closed bzp2010 closed 1 year ago

bzp2010 commented 1 year ago

Expose the connection pool configuration upwards, which will allow users to control the details of the pool themselves.

This PR is mainly to solve the problem when users use the same connection information, i.e. IP and port (they will be used as pool names according to cosocket rules), and users may bind using several different authentication information, such as normal user and administrator, when the connections already in the pool cannot be reused, because we cannot solve the problem of concurrent requests from multiple workers. So providing this parameter will allow users to use different keys as connection pool names to circumvent the above situation.

bzp2010 commented 1 year ago

Since the _send_receive of the socket is not exported, and initializing the socket and reclaiming the connection are both performed in a single function there (no intermediate state), we will have to check the logic related to TCP multiplexing empirically.

soulbird commented 1 year ago

Documentation needs to be added