HTTP server sockets & browsers

PeterR
Posts: 311
Joined: Mon Jun 04, 2018 2:47 pm

HTTP server sockets & browsers

Postby PeterR » Sat Feb 15, 2020 3:07 pm

I am using the esp32 httpd server with .max_open_sockets = 13
I cannot go bigger than this as the LWIP option has a maximum of 16 sockets.
What has happened to the other 3 sockets?

I can open multiple copies of my website in Firefox. I cannot open my website in Firefox and Chrome at the same time however.
Indeed once I have used Firefox I must close all Firefox windows before I can open my website in another browser.

I have quite a few files in my website. I am guessing that some browsers make concurrent file requests during initial load each with its own connection and so socket.

I need to support multiple browser connections. How do I get the browser to drop its sockets?
EDIT: Or overwise ensure that I can have multiple browsers connected.

PeterR
Posts: 311
Joined: Mon Jun 04, 2018 2:47 pm

Re: HTTP server sockets & browsers

Postby PeterR » Sat Feb 15, 2020 3:31 pm

I am guessing that this is due to 'Connection: Keep-Alive' header. HTTP 1.1 assumes that all connections are keep alive.
I believe that I can add a header:
'Connection: Close'
or
'Keep-Alive: timeout=5, max=100'
'Connection: Keep-Alive'
To specify limits on how long the socket will stay open.

To control persistence and closing.
When I reply 'Connection: Close' does that mean that the browser should close or must I close?

If I must close. How do I get socket information from httpd?

Who is online

Users browsing this forum: MSN [Bot] and 51 guests