infinote.org

collaborative editing

Directory

The directory is the central entry point for all Infinote communication. As pointed out in the previous section, after connection establishment the initiating host (in the following called the "client") implicitely joins the "InfDirectory" group published by the accepting host (the "server"). The group uses the "central" method for communication. Note that even though we are talking about client and server here, and that even though most messages in the InfDirectory group are of request-reply type this does not mean that the Infinote protocol is solely client-server based. The directory is the entity which contains and distributes information about documents available at a host and the messages presented in this section specify how they are queried. Once subscribed to a session the communication can be performed by any available communication method supported on the underlying network and does not have to be of client-server type.

Note that what documents are available in a directory is totally up to its host. For example, a dedicated Infinote server could publish a directory on its file system whereas a text editor could publish all currently open documents. A host can also make available sessions published by other hosts that it is subscribed to.

Node types

The directory represents a hierarchical tree of documents. Each node in the directory has a unique (for that directory) ID number. A node can either be a subdirectory node which in turn can contain other nodes (children), or it can be a document node which contains a document and which can be used as an entry point to edit that document collaboratively. Every node also is assigned a type. If the type is "InfSubdirectory" then it is a subdirectory node (as explained above), otherwise it is a document node hosting a document of the given type. For example, "InfChat" is for chat sessions and "InfText" for plain text documents. The welcome message (see below) specifies what type of sessions a server can handle.

There is one root node in the directory. All other nodes are children of that root node, either directly or indirectly (that is they are children of another node which in turn is a child of the root node, directly or indirectly). The root node of a directory has always type "InfSubdirectory" and ID 0 (zero).

Exploration and Subscription

Nodes of type "InfSubdirectory" can be "explored" by clients. Exploring a node means sending the content of the node to the client and also notifying it when there is any change to the subdirectory (such as nodes being added or removed later).

Clients can "subscribe" to nodes of other types. When a client is subscribed to a node then it is sent a copy of the full node content (a process called "synchronization") and then notified of any changes to it. Synchronization and subscription take place in a different group than "InfDirectory" so that other communication methods can be used and so that communication in InfDirectory is not blocked by a potential lengthy synchronization. How exactly the initial node content and any further changes are transmitted depends on the type of the node. The common messages that are used for all node types are described in the sections ?Synchronization and ?Session, respectively. Nodes of type "InfChat" are documented in ?Chat Session and nodes of type "InfText" are described in ?Text Session.

Sequence numbers and sequence IDs

In the welcome message (see below) each client is assigned a unique sequence ID, an integral positive number. For each request a client sends to the server it can optionally specify a sequence number. The server's reply to the request then contains both the sequence ID of the client initiating the request and the sequence number. This allows clients to perform multiple requests without waiting for a reply from the server. The sequence ID is also included since the reply for some requests are sent to the whole group (for example if a new node has been created in response to a client request).

Messages

TODO