Implement my own remote desktop in Java
I tried to implement my own remote desktop solution in Java Using sockets and TCP / UDP
So in order to move the mouse and click, I can use the robot class I have two questions:
>What about sending video? I know that robot humans can capture the screen, so I should send images in order and display them on the other side of the connection? Is this the best way to implement remote desktop? > Should TCP or UDP also be used? I think UDP will be more difficult to implement because I have to figure out which image comes from another
Solution
What you want to do will work, but it's very slow Before sending an image over the network, the image must be compressed Reduce the number of colors before compression In addition, only image parts that have changed since the last update are transmitted
When transmitting mouse coordinates, the update occurs only when the new mouse position is more than x pixels or Y seconds from the last position Otherwise you will spend so much traffic on the mouse position that there is no space for the image
UDP will be the best solution because it is the fastest video stream (that's what you're doing)