esp32_https_server
esp32_https_server copied to clipboard
Parallel communication
I'm using a sample file in the Examples/Async-Server directory.
I need to send very large response files.
Currently, communication looks like this:
- receiving the request from the client 1
- sending a response to the client 1
- receiving the request from the client 2
- sending a response to the client 2 ... etc.
So customer 2 has to wait until client 1 gets the whole answer. I want to avoid it.
And I would like to handle all requests in parallel:
- receiving the request from the client 1
- sending a first packet response to the client 1
- receiving the request from the client 2
- sending a first packet response to the client 2
- sending a next packet response to the client 1
- sending a next packet response to the client 2 ... etc. every loop
Is it possible? How can I do this?
At the moment that's not possible, as the handler function would need to tell the server that the request is only processed partially. I assume that it's possible, but it would need some major changes to how HTTPConnection handles the requests.
The only thing that the ASync-Server example can provide is that your regular loop() code would run during long requests, if the handler function blocks (e.g. due to waiting for I/O).