Register
handmade.network»Forums»How to design a reliable and fast remote UI ?
Hui
1 posts
How to design a reliable and fast remote UI ?
1 week, 3 days ago Edited by Hui on Nov. 13, 2020, 1:27 a.m.
I have an app running on a server, It has two remote UIs, one is for developer, the other is for display only.


app_ui1 <--> app <--> app_ui2


I wonder what is a good way to architect the communication part to make it reliable and fast.


Thanks!
Simon Anciaux
919 posts
How to design a reliable and fast remote UI ?
1 week, 2 days ago
I know nothing about network programming, but this seems like too broad of a question and not much information. You probably need to experiment yourself first, and based on that experience come back with more precise question or problem.
81 posts / 1 project
How to design a reliable and fast remote UI ?
3 days, 5 hours ago
Lightweight method
Only send the data that needs to be displayed, then interpret it locally. Good for text and graphs like in Arduino's remote debugger but reversed. This allow the client side to have different programs for different hardware platforms without having to ever change the server program.

Example:
temperature: 24
temperature: 25
temperature: 27

Reusable method
Implement something close to the X11 protocol or a browser, so that you can reuse the same program for the client side even if the server program updates. Then use passive rendering to only redraw when something changes. Create an indexed image buffer for each reusable resource and then send draw commands to the final canvas with a minimum amount of data sent.

Example:
upload pixelData to resource 1
upload pixelData to resource 2
draw resource 1 to canvas at x1, y1
draw resource 2 to canvas at x2, y2
draw resource 1 to canvas at x1, y1
draw resource 2 to canvas at x2, y2