High Level Logic of an HTTP Server on 8266

AgentSmithers
Posts: 142
Joined: Sat Apr 01, 2017 1:21 am
Contact:

High Level Logic of an HTTP Server on 8266

Postby AgentSmithers » Thu Jan 17, 2019 5:02 am

Hi Everyone!
This forum is slowly withering away and I hope I can still catch someone knowledgeable about this subject. When programming a Socket for the ESP there are so far about two things that are on my radar when I'm coding the Data Received function.

1: Which client sent the data
It seems the Function that receives the data doesn't directly pass a Parameter of which one of the many clients could have sent the data but I am currently Identifying them by their Remote port that way it's unique and when the socket closes I wipe the record from memory.

2: Data can come Fragmented
This was my most recent issue when receiving a file being sent from a web browser.


After keeping these two in mind, it seems my Data receive function should really be Dynamically allocating Buffers one for each client to store their independent data in and when the content length is matched then process the information at that point. Does anyone have any thoughts on how to properly address this workflow?

Who is online

Users browsing this forum: No registered users and 6 guests