C# Client 0.0.0.7
C# Library to interface with Corelink
Loading...
Searching...
No Matches
CoreLink.Control Class Reference

Singleton class to communicate with Corelink. More...

Public Member Functions

 Control ()
 
 Control (bool debug)
 
void connect (Config config)
 Connects with client at the specified Port and IP number. Throws an error if something goes wrong.
 
async void ConnectToServer ()
 
bool login (Credentials credentials)
 Logs into the server after connecting after verifying login credentials like username,password and token defined in the 'login' function.
 
uint createSender (SenderStreamParams streamParams)
 Asks Corelink to create a sender stream. At minimum, this requires a workspace name and a type. The stream parameters are: workspace, metadata, type, senderID The stream also requires networking information to know where to send the data: protocol type (UDP, TCP, WS), source IP (Set to your computer/router's IP address) source port (Your computer's port number. Set to 0 if you don't know this or have a firewall)
 
List< uint > createReceiver (ReceiverStreamParams streamParams)
 Asks Corelink to create a receiver stream. At minimum, this requires a workspace name and a list of types. The parameters are the same as sender streams except that types is a list. It also has an echo parameter which is by default false. It has a 'receiverid' parameter in case there is pre-existing receiver stream that needs to be updated. The request also requires a token, created on login An optional id is included in the request which the server will relay back in the response to make sure that the requests and responses are paired properly.
 
List< uint > subscribe (List< uint > streamIDs)
 Tells Corelink to subscribe a certain receiver stream to one or more sender streams.
 
List< uint > unsubscribe (List< string > streamIDs)
 Unsubscribes the program from various sender streams.
 
List< string > disconnect ()
 Disconnects streams of a specific stream filter type, or all current streams if no parameters are given.
 
List< string > disconnect (StreamFilter filter)
 
void exit ()
 Disconnects all available streamIDs and stops the WebSocket/UDP Sockets.
 
void send (uint streamID, byte[] header, byte[] data)
 Sends a UDP message to Corelink for a specific sender stream id.
 
bool addWorkspace (string workspace)
 Asks the server to create a new workspace.
 
bool rmWorkspace (string workspace)
 Asks the server to remove a workspace.
 
bool setDefaultWorkspace (string workspace)
 Requests Corelink to set the default workspace.
 
string getDefaultWorkspace ()
 Asks Corelink for the current default workspace.
 
List< string > listWorkspaces ()
 Asks corelink for all available workspaces.
 
List< string > listFunctions ()
 Asks the server for all available client functions.
 
List< string > listServerFunctions ()
 Asks the server for all server callback functions. Currently there is Update, Subscriber, OnStale, and Dropped.
 
string describeFunction (string function)
 Asks the server for a specific client side function's description.
 
string describeServerFunction (string function)
 Asks the server for a specific server callback function's description.
 
JSONArray listStreams (StreamFilter filter)
 Asks the server for a list all streams.
 
JSONNode streamInfo (uint streamID)
 Asks the server for information about a sender stream.
 
List< string > listUsers ()
 

Static Public Member Functions

static void Print (string message)
 

Static Public Attributes

static bool debug
 debug turns on or off verbose logging. Control.Print() statements will only print if debug mode is on
 
static int timeoutIterations = 100
 In some callbacks, the code is waiting on a response from the server. This specifies the number of 100 ms iterations to wait before throwing an error.
 

Detailed Description

Singleton class to communicate with Corelink.

This file emulates clients/javascript/corelink.lib.js and is designed to have the same functionality as the NodeJS library. Everything in this C# client library will be in the CoreLink namespace

Definition at line 20 of file Control.cs.

Constructor & Destructor Documentation

◆ Control() [1/2]

CoreLink.Control.Control ( )

Definition at line 46 of file Control.cs.

◆ Control() [2/2]

CoreLink.Control.Control ( bool debug)

Definition at line 47 of file Control.cs.

Member Function Documentation

◆ addWorkspace()

bool CoreLink.Control.addWorkspace ( string workspace)

Asks the server to create a new workspace.

Parameters
workspaceName of new workspace
Returns
true if successful, false if not

Definition at line 378 of file Control.cs.

◆ connect()

void CoreLink.Control.connect ( Config config)

Connects with client at the specified Port and IP number. Throws an error if something goes wrong.

Parameters
configRefers to connection configuration like ControlPort and ControlIP

Definition at line 62 of file Control.cs.

◆ ConnectToServer()

async void CoreLink.Control.ConnectToServer ( )

Definition at line 82 of file Control.cs.

◆ createReceiver()

List< uint > CoreLink.Control.createReceiver ( ReceiverStreamParams streamParams)

Asks Corelink to create a receiver stream. At minimum, this requires a workspace name and a list of types. The parameters are the same as sender streams except that types is a list. It also has an echo parameter which is by default false. It has a 'receiverid' parameter in case there is pre-existing receiver stream that needs to be updated. The request also requires a token, created on login An optional id is included in the request which the server will relay back in the response to make sure that the requests and responses are paired properly.

Parameters
streamParams
Returns
list of streamIDs to subscribe to

Definition at line 176 of file Control.cs.

◆ createSender()

uint CoreLink.Control.createSender ( SenderStreamParams streamParams)

Asks Corelink to create a sender stream. At minimum, this requires a workspace name and a type. The stream parameters are: workspace, metadata, type, senderID The stream also requires networking information to know where to send the data: protocol type (UDP, TCP, WS), source IP (Set to your computer/router's IP address) source port (Your computer's port number. Set to 0 if you don't know this or have a firewall)

Sender streams can only have one workspace and one type. Current workspaces are Holodeck, Chalktalk, Infinit They must be created ahead of time Example types are: unity, 3d, iclone, audio, messagebus, ... etc These are user defined and do not need to be created ahead of time. They can be any string as long as the receiver is matching the same string. If an existing sender streamID already exists, it can be updated by passing that streamID into the 'senderID' parameter.

The request also requires a token, created on login An optional id is included in the request which the server will relay back in the response to make sure that the requests and responses are paired properly

Parameters
streamParamsSenderStreamParams with all pertinent information
Returns
sender streamID

Definition at line 133 of file Control.cs.

◆ describeFunction()

string CoreLink.Control.describeFunction ( string function)

Asks the server for a specific client side function's description.

Parameters
functionfunction name for query
Returns
description

Definition at line 511 of file Control.cs.

◆ describeServerFunction()

string CoreLink.Control.describeServerFunction ( string function)

Asks the server for a specific server callback function's description.

Parameters
functionfunction name for query
Returns
description

Definition at line 529 of file Control.cs.

◆ disconnect() [1/2]

List< string > CoreLink.Control.disconnect ( )

Disconnects streams of a specific stream filter type, or all current streams if no parameters are given.

Returns
Array of disconnected streamIDs

Definition at line 296 of file Control.cs.

◆ disconnect() [2/2]

List< string > CoreLink.Control.disconnect ( StreamFilter filter)

Definition at line 309 of file Control.cs.

◆ exit()

void CoreLink.Control.exit ( )

Disconnects all available streamIDs and stops the WebSocket/UDP Sockets.

Definition at line 347 of file Control.cs.

◆ getDefaultWorkspace()

string CoreLink.Control.getDefaultWorkspace ( )

Asks Corelink for the current default workspace.

Returns
workspace name

Definition at line 431 of file Control.cs.

◆ listFunctions()

List< string > CoreLink.Control.listFunctions ( )

Asks the server for all available client functions.

Returns
Array of available functions

Definition at line 469 of file Control.cs.

◆ listServerFunctions()

List< string > CoreLink.Control.listServerFunctions ( )

Asks the server for all server callback functions. Currently there is Update, Subscriber, OnStale, and Dropped.

Returns
Array of server callback functions

Definition at line 490 of file Control.cs.

◆ listStreams()

JSONArray CoreLink.Control.listStreams ( StreamFilter filter)

Asks the server for a list all streams.

Parameters
filterOptional filter by workspace name and types
Returns
List of available streams

Definition at line 550 of file Control.cs.

◆ listUsers()

List< string > CoreLink.Control.listUsers ( )

Definition at line 592 of file Control.cs.

◆ listWorkspaces()

List< string > CoreLink.Control.listWorkspaces ( )

Asks corelink for all available workspaces.

Returns
List<string> of all available workspaces

Definition at line 446 of file Control.cs.

◆ login()

bool CoreLink.Control.login ( Credentials credentials)

Logs into the server after connecting after verifying login credentials like username,password and token defined in the 'login' function.

Parameters
credentialsContains username and password, writes to token
Returns
true if successful, false if not

Definition at line 93 of file Control.cs.

◆ Print()

static void CoreLink.Control.Print ( string message)
static

Definition at line 634 of file Control.cs.

◆ rmWorkspace()

bool CoreLink.Control.rmWorkspace ( string workspace)

Asks the server to remove a workspace.

Parameters
workspaceName of workspace to be deleted
Returns
True if successful, false if not

Definition at line 396 of file Control.cs.

◆ send()

void CoreLink.Control.send ( uint streamID,
byte[] header,
byte[] data )

Sends a UDP message to Corelink for a specific sender stream id.

Parameters
streamIDSender stream ID this data belongs to
headerUser custom header information
dataData to send to Corelink

Definition at line 361 of file Control.cs.

◆ setDefaultWorkspace()

bool CoreLink.Control.setDefaultWorkspace ( string workspace)

Requests Corelink to set the default workspace.

Parameters
workspaceworkspace name
Returns
true if successful, false if not

Definition at line 414 of file Control.cs.

◆ streamInfo()

JSONNode CoreLink.Control.streamInfo ( uint streamID)

Asks the server for information about a sender stream.

Parameters
streamIDsender's streamID
Returns
JSONNode of all the information

Definition at line 575 of file Control.cs.

◆ subscribe()

List< uint > CoreLink.Control.subscribe ( List< uint > streamIDs)

Tells Corelink to subscribe a certain receiver stream to one or more sender streams.

Parameters
streamIDsSender streams to subscribe to
Returns
List of sender streamIDs that have been subscribed to

Definition at line 230 of file Control.cs.

◆ unsubscribe()

List< uint > CoreLink.Control.unsubscribe ( List< string > streamIDs)

Unsubscribes the program from various sender streams.

Parameters
filterSender streams ids to unsubscribe from
Returns
List of stream ids successfully unsubscribed from

Definition at line 266 of file Control.cs.

Member Data Documentation

◆ debug

bool CoreLink.Control.debug
static

debug turns on or off verbose logging. Control.Print() statements will only print if debug mode is on

Definition at line 25 of file Control.cs.

◆ timeoutIterations

int CoreLink.Control.timeoutIterations = 100
static

In some callbacks, the code is waiting on a response from the server. This specifies the number of 100 ms iterations to wait before throwing an error.

Definition at line 29 of file Control.cs.


The documentation for this class was generated from the following file: