As the title says... Chat on...

User avatar
By picstart
#8673 srv=net.createServer(net.TCP,20) ---20 sec timeout
the lua server gets its socket assigned during on("receive" of the browser's GET
now if the web page has <img src the socket will change in its GET so this second <img GET will only proceed if the starting socket is first closed
since srv is just a one socket listener.
How many sockets attached to a port Ex 80 can lua listen to?
I'm working on getting lua to serve the web page and the <img requests from individual lua files ( *gif and one web page *htm file )
I have it working so far with a web page and one <img gif file
Has anyone got a web page and *gif files served from the lua file system working?
User avatar
By picstart
#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?