After the control connection is established, streams can be instatiated in three different kinds of protocols:
If one client sends a stream in one protocol and another client receives the stream in a different protocol the server will automatically convert between the protocols.
The packets that are sent can have a variable length. The first 6 bytes are contain the packet size information. The first 2 bytes denote the header length as an integer starting after the 6th byte. The next 4 bytes denote the data length starting after the header. The header is a Json string with packet based header information. At the moment only a stream id and a millisecond unix timestamp of synchronized time is submitted. The data itself is treated as a binary blob and can have any format. With the 6 header bytes future adaptation of the header can be achieved. We recommend that the data package is not larger than a few KB if the transfer is time sensitive. The TCP data stream is not encrypted. If encryption is desired, WSS streams are available.
Size in bytes | Type | Content | Description |
---|---|---|---|
2 | header size | UInt16LE | max bytes: 32768, ! if the high bit is set, the server will decode the header (this is neccessary for stamp and limit tags) |
2 | data size | UInt32LE | max bytes: 65528) |
2 | streamID | together with federatonID UInt64LE | this is the streamID that the server assigns and it works in conjunction with the federationID, max streams: 65536) |
2 | federationID | together with streamID UInt64LE | this is the federationID that identifies the corelink server, it works in conjunction with the streamID, max servers: 65539) |
0 - 32768 | header | JSON | the size of header is determined by header size. The high bit in the header size determines if this header gets decoded and the server reacts to information like stamp and limit in the header. Otherwise the header is ignored |
0-65539 | data | binary | the size of the data is determined by data size |
ID - the stream ID for the packet time - the client time stamp for the packet
Valid keys in the optional json header are:
stamp - a key that will make the server put its time stamp and return the
packet to its source
packet - if the client has to cut a packet into several small blocks it will
have to send a packet x/y where x is the current packet number and y is
the total packet count
limit:[streamIDs] (limits the paket destination to a set of streamids)