openai / go-vncdriver

Fast VNC driver
MIT License
123 stars 60 forks source link

Send Key and Pointer events in a single packet #4

Closed tlbtlbtlb closed 7 years ago

tlbtlbtlb commented 7 years ago

For KeyEvent and PointerEvent messages, it sends it as 4 packets (04) (00) (00) (00 00 00 60) in the example below for key 96. I was suspicious that this was causing Xvnc to get confused, but I couldn't demonstrate it. But it seems like a worthwhile performance optimization when running over the internet anyway.

02:24:35.257813 IP localhost.33927 > localhost.5900: Flags [P.], seq 215380:215381, ack 322802389, win 18935, options [nop,nop,TS val 26393028 ecr 26393028], length 1
    0x0034:  04
02:24:35.257821 IP localhost.33927 > localhost.5900: Flags [P.], seq 215381:215382, ack 322802389, win 18935, options [nop,nop,TS val 26393028 ecr 26393028], length 1
    0x0034:  00
02:24:35.257825 IP localhost.33927 > localhost.5900: Flags [P.], seq 215382:215383, ack 322802389, win 18935, options [nop,nop,TS val 26393028 ecr 26393028], length 1
    0x0034:  00
02:24:35.257833 IP localhost.33927 > localhost.5900: Flags [P.], seq 215383:215384, ack 322802389, win 18935, options [nop,nop,TS val 26393028 ecr 26393028], length 1
    0x0034:  00 
02:24:35.257837 IP localhost.33927 > localhost.5900: Flags [P.], seq 215384:215388, ack 322802389, win 18935, options [nop,nop,TS val 26393028 ecr 26393028], length 4
    0x0034:  0000 0060
jeremyschlatter commented 7 years ago

👍