Java Reference

KOS Networking Concepts

Introduction

This page explains "KOS Networking". KOS networking makes it easy to communicate between nodes, whether those are on the local network, or located on a remote network.

Overview

Before digging into the concepts, let’s define the relevant KOS terms:

Node

A "node" is a computer running the KOS operating system.

If that node is also running Java, then it can participate in the KOS network.

These nodes exist in drink dispensers and in the KOS Studio’s simulators.

Zone

A "zone" identifies a cluster of nodes, where all routers in the same zone know about each other, can route between them, and can typically recover if there’s a failure.

Router

Exactly one "router" runs on every node. Its routerId is a unique (within its zone) identifier for the router.

Client

A "client" is any non-router piece of software that makes a websocket connection to a KOS router. The clientId is a unique identifier for a router. This is typically a browser, but can be anything that can open a websocket. The clientId for the router itself is always zero.

Concepts

Now that we have a basic understanding of the terms, we can now describe the KOS networking concepts.

Addresses

An address is composed of three things, in this order:

  • Zone

  • Router ID

  • Client ID

Each of these is separated by a colon:

zone:routerId:clientId

The following shows the KosAddress class in stripped-down form:

API: KosAddress class
public class KosAddress {
    private final String zone;
    private final String routerId;
    private final String clientId;

    // Constructors:
    public KosAddress(String addr);
    public KosAddress(String zone, String routerId, String clientId);

    // Getters:
    // (as expected)

    // Methods:
    public String toString();  // returns zone:routerId:clientId
    public String toRouter();  // returns zone:routerId:0
}

Well-known message types

There are a number of well-known message types.

kos.http.request

kos.http.response

kos.broker

kos.broker.topic

kos.broker.subscribe

kos.broker.unsubscribe

Previous
Next
On this page
Java Development
Seamlessly transition from Legacy+ systems to Freestyle microdosing and advanced distributed dispense systems.
UI Development
Using KOS SDKs, integrating Consumer and Non-consumer facing UIs becomes seamless, giving you less hassle and more time to create.
Video Library
Meet some of our development team, as they lead you through the tools, features, and tips and tricks of various KOS tools.
Resources
Familiarize yourself with KOS terminology, our reference materials, and explore additional resources that complement your KOS journey.
Copyright © 2024 TCCC. All rights reserved.