I just waiting two codes to compare with.
My apologizes to ardhuru for this
You commented your ESP code at beginning of the topic but i can´t find source B4A and source ESP code.
I didn´t realize that you posted the whole ESP code.
ESP Basic was unknown for me until now, so i saw your code as a pseudo code.
I have a B4A license and Im working in something similar to this project, UDP communication, so i don' t need gifts because i pay my tools.
Perhaps I have misunderstood some lines because english is not my natural language but you did not read my last line when i wrote
PD: Sorry if i don´t find your files and you really have uploaded them.