Understanding Corelink's Architecture
What is Corelink
Corelink is a programmable low-latency messaging platform. It is intended to be a powerful communication layer to connect real-time applications such as audio, video, motion capture, virtual reality, etc.
Instead of creating ad-hoc communication protocols for your programs, Corelink allows you to connect many different types of applications, taking care of selecting the streams your application can consume based on their metadata.
Corelink also allows the user to wire streams on the fly and inserting plugins that process, filter, mix, or re-encode streams on the server.
Components
Corelink consists of clients, implemented via one of our libraries or following our simple protocol, a server to which clients connect and which organizes the routing of messages, and relays which do the actual forwarding and can be provided by the server process in the simplest case.
Clients and relays communicate with the server over a simple JSON-based RPC protocol over TCP or WebSocket: the control protocol. The server can optionally receive credentials to authenticate clients and restrict their access level.
Corelink messages are exchanged between clients and relays over a simple binary protocol over TCP, UDP, or WebSocket.
Messaging concepts
Data is routed through streams. To publish data, a client creates a sender stream with the server and receives a stream ID that it can use to send messages through a relay. Similarly, to receive data, a client creates a receiver stream with the server that it can use to consume data from a relay.
Sender streams are associated with tags that are commonly used to identify the type of data that is sent through, for example audio
, mp4
, motioncap
, etc. When creating a receiver, you can express your interest in specific tags, which will allow you to subscribe to those streams automatically.