Can UltraVNC handle partial messages?

Developers may discuss here.

Can UltraVNC handle partial messages?

Postby vnc_novice » 2015-12-03 07:09

I implemented my own RFB server and everything is working fine on the Windows desktop. When using the implementation on Windows CE, which has a send buffer limitation of about 16k, the UltraVNC client either displays nothing at all or only something which apperars to be the first rectangle in the FrameBufferUpdate message.
The socket function 'send' splits the full FrameBufferUpdate message into submessages. Can UltraVNC handle this? If not, what could I do?
vnc_novice
 
Posts: 2
Joined: 2015-12-02 17:28

Re: Can UltraVNC handle partial messages?

Postby vnc_novice » 2015-12-05 14:01

Did some more research and found out the following:
UltraVNC can handle partial messages provided they are properly sliced. This means that you can send the FrameBufferUpdate message header including the number of rectangles to follow in the first message and then each rectangle it its own message. By this you can update the whole screen provided each one of the rectangles fits into the send buffer.
vnc_novice
 
Posts: 2
Joined: 2015-12-02 17:28

Re: Can UltraVNC handle partial messages?

Postby Rudi De Vos » 2015-12-05 16:02

while ( recv_size<required_size)
size=recv();
recv_size=recv_size+size
)
The viewer or server call the recv() multiple times

The same for sending, just loop until all data has been sended, this is indepened on the actual sendbuffer,
with a small sendbuffer you just send it in smaller packets.
while ( send_size<required_size)
size=send()
send_size=send_size+size;


Wifi split data in small packets, so split and combine is part of the tcp protocol.
On server/viewer you keep repeating send recv until all data has been handled.
Rudi De Vos
Admin & Developer
Admin & Developer
 
Posts: 5411
Joined: 2004-04-23 10:21


Return to Developer discussions (mainly user-mode)

Who is online

Users browsing this forum: No registered users and 1 guest