- Mon Feb 02, 2015 10:14 am
#8777
The mystery of a self contained server continues.
Context
All files the web page and several *.gif files referenced in the web page by <img src are in the lua file system.
Constraint
lua file system only allows one file to be open at a time.
Apparent constraint
lua server only allows one socket open at a time
Issue
Web page file is opened and sent upon browser sending GET/ since browser is asynchronous to the server several GET/ gif resource requests will be sent while web page is being served to the browser. If GET/ *gif is allowed to trigger on:receive it will change the socket and mess up the sending of the remainder of the web page.
Attempt to work around
I can get two gif served if I open the gate to the on:receive only when a file ( web page or *,gif) is not being served
GET?'s that arrive when the gate is closed aren't it seems buffered. However the browser will resend the requests so an additional gif can be served.
The browser seeing to much delay stops resending the requests so only gif's can be sent.
Does anyone have a solution ( I know the web page could ask for another server to serve the *.gif resources. but it would not be self contained)?
Will the esp8266 continue to be a very limited server that can only handle very very basic web pages?