Chapter 9. Example of communication

There is example of authorization and document request in the folowing table.

Table 9.1. Example of Authorization and pushDocument

Direction

(C=client, S=server)

MethodDescription

C → S

hello

Send hello packet

S → C

Ret hello

Response to the hello packet

C → S

authorize

Autorization request

S → C

Ret authorize

Server response for authorization request

C → S

setState

Client change protocol state.

S → C

pushDocument

Server sends new document to the client. Clients check its own cache and requests missing pages.

C → S

requestFile

Page request

S → C

Data, Type=1

Page data - server response


Next example shows how-to send changes back to the server.

Table 9.2. Example of Document Save Operation

Direction

(C=client, S=server)

MethodDescription

C → S

saveDocument

Save document to the server, server has to create new page ids and send them back.

S → C

Ret saveDocument

Server is returning new IDs which will be used to send data.

C → S

Data, type=1

Page data.

S → C

receivedDocument

Notification about succesfully received document. Notification is sent when whole document is complete.