DAVID4 SDK  1.8.7
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
Low Level Interface

Overview

Warning
You only need the following information, if you want to implement remote functions on a specific platform that is not directly supported by our standard C++ API.

A connection between one client and one server consists of two TCP/IP channels: One control channel and one binary data channel. A request from a client via the control channel is answered by the server using the same control channel. These requests and answers are transmitted in human readable ASCII. JSON-RPC 2.0 is used as a protocol (see figure below for an example). Big data blocks are transmitted via a separate Binary Channel.

client-server-jsonrpc.png
More detailed view on communication between client and server

JSON-RPC 2.0

"JSON-RPC is a stateless, light-weight remote procedure call (RPC) protocol. Primarily this specification defines several data structures and the rules around their processing. It is transport agnostic in that the concepts can be used within the same process, over sockets, over http, or in many various message passing environments. It uses JSON (RFC 4627) as data format." ... more

The JSON-RPC functions that are supported by a DAVID server can be found in the documentation of the following function enumerations:

Binary Channel

Some functions (e.g. david::ShapeFusion::GetVertexPositions) need to transmit large amount of data. In these cases, the ASCII control channel would cause too much overhead. Therefore, binary data blocks are transmitted via a secondary binary channel. The sequence is as follows:

  1. Client sends JSON-RPC request via control channel.
  2. Servers sends JSON-RPC answer via same control channel.
  3. Client reads from answer how many bytes it should receive or send via binary channel.
  4. Client reads/writes data from/to the binary channel.
Note
The implementation of a binary channel is only need, if remote functions are called that make use of the binary channel. Most remote functions do not use the binary channel.