Closed bzp2010 closed 1 year ago
In addition, the code uses receiveuntil and while true for reading data, which in my perception is a risk of blocking the worker, and I wonder if there is a good way to improve it (its description and reasons are in the code comments).
The loop of receiveuntil
will not block the worker, even if the package is large, it's limited to the length of socket buffer.
The loop of receiveuntil will not block the worker, even if the package is large, it's limited to the length of socket buffer.
@kingluo My concern is that if the data has already been read (i.e. there is no more data in the buffer), then calling the reader again will block until read timeout, at which point what is its behavior? 🤔
The loop of receiveuntil will not block the worker, even if the package is large, it's limited to the length of socket buffer.
@kingluo My concern is that if the data has already been read (i.e. there is no more data in the buffer), then calling the reader again will block until read timeout, at which point what is its behavior? 🤔
receiveutil
is a nonblocking method of cosocket, it just analyzes the data according to dfa pattern, which yields if it needs more data. Timeout event, if exists, will trigger next resume.
receiveutil
is a nonblocking method of cosocket, it just analyzes the data according to dfa pattern, which yields if it needs more data. Timeout event, if exists, will trigger next resume.
Get it, this means that that HTTP request that triggered the LDAP operation is stuck and doesn't block other requests, which is great.
Support building LDAPv3 search request and response data parsing.
In addition, the code uses receiveuntil and while true for reading data, which in my perception is a risk of blocking the worker, and I wonder if there is a good way to improve it (its description and reasons are in the code comments).