Developers may discuss here.


Postby pyromanci » 2014-09-01 18:08


I've been working on a android vnc server (for my personal use/experimenting). I've taken some existing projects and have been able to port them over just fine. One feature I would like to play with implementing is the file transfer feature.

While shifting through the code and a few clients code. I have been having a hard time coming up with how the client/server tells the other "hey I support the FTProtocol".

I see bit like:
Code: Select all
    rfbFileTransferMsg ft;
    memset(&ft, 0, sizeof ft);
    ft.type = rfbFileTransfer;
    ft.contentType = rfbFileTransferProtocolVersion;
    ft.contentParam = FT_PROTO_VERSION_3;
    m_socket->SendExact((char *)&ft, sz_rfbFileTransferMsg, rfbFileTransfer);

When the server is reading the SetEncoding message I do see
Code: Select all
if (Swap32IfLE(encoding) == rfbEncodingFTProtocolVersion)

Problem is when I look at the client's code. I cannot see this encoding being set and sent in the initial hand shake.

So I'm a little confused at the moment and any insight in how/when the server/client should be telling the other that it supports file transfer would be great.
Posts: 4
Joined: 2013-12-05 18:29

Re: rfbFileTransferProtocol

Postby Rudi De Vos » 2014-09-01 19:17

Its handle as a pseudo encoder.
The viewer and server exchange the supported encoders ( like hextile, tight,zrle..), rfbEncodingFTProtocolVersion
Code: Select all
encs[se->nEncodings++] = Swap32IfLE(rfbEncodingServerState);
    encs[se->nEncodings++] = Swap32IfLE(rfbEncodingEnableKeepAlive);
    encs[se->nEncodings++] = Swap32IfLE(rfbEncodingFTProtocolVersion);

Code: Select all
if (Swap32IfLE(encoding) == rfbEncodingFTProtocolVersion) {
                        need_ft_version_msg = true;
                  vnclog.Print(LL_INTINFO, VNCLOG("FTProtocolVersion protocol extension enabled\n"));

Code: Select all
if (need_ft_version_msg)
            // send a ft protocol message to client.
            need_ft_version_msg = false;
Rudi De Vos
Admin & Developer
Admin & Developer
Posts: 5276
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