C# Client 0.0.0.7
C# Library to interface with Corelink
|
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. | |
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.
CoreLink.Control.Control | ( | ) |
Definition at line 46 of file Control.cs.
CoreLink.Control.Control | ( | bool | debug | ) |
Definition at line 47 of file Control.cs.
bool CoreLink.Control.addWorkspace | ( | string | workspace | ) |
Asks the server to create a new workspace.
workspace | Name of new workspace |
Definition at line 378 of file Control.cs.
void CoreLink.Control.connect | ( | Config | config | ) |
Connects with client at the specified Port and IP number. Throws an error if something goes wrong.
config | Refers to connection configuration like ControlPort and ControlIP |
Definition at line 62 of file Control.cs.
async void CoreLink.Control.ConnectToServer | ( | ) |
Definition at line 82 of file Control.cs.
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.
streamParams |
Definition at line 176 of file Control.cs.
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
streamParams | SenderStreamParams with all pertinent information |
Definition at line 133 of file Control.cs.
string CoreLink.Control.describeFunction | ( | string | function | ) |
Asks the server for a specific client side function's description.
function | function name for query |
Definition at line 511 of file Control.cs.
string CoreLink.Control.describeServerFunction | ( | string | function | ) |
Asks the server for a specific server callback function's description.
function | function name for query |
Definition at line 529 of file Control.cs.
List< string > CoreLink.Control.disconnect | ( | ) |
Disconnects streams of a specific stream filter type, or all current streams if no parameters are given.
Definition at line 296 of file Control.cs.
List< string > CoreLink.Control.disconnect | ( | StreamFilter | filter | ) |
Definition at line 309 of file Control.cs.
void CoreLink.Control.exit | ( | ) |
Disconnects all available streamIDs and stops the WebSocket/UDP Sockets.
Definition at line 347 of file Control.cs.
string CoreLink.Control.getDefaultWorkspace | ( | ) |
Asks Corelink for the current default workspace.
Definition at line 431 of file Control.cs.
List< string > CoreLink.Control.listFunctions | ( | ) |
Asks the server for all available client functions.
Definition at line 469 of file Control.cs.
List< string > CoreLink.Control.listServerFunctions | ( | ) |
Asks the server for all server callback functions. Currently there is Update, Subscriber, OnStale, and Dropped.
Definition at line 490 of file Control.cs.
JSONArray CoreLink.Control.listStreams | ( | StreamFilter | filter | ) |
Asks the server for a list all streams.
filter | Optional filter by workspace name and types |
Definition at line 550 of file Control.cs.
List< string > CoreLink.Control.listUsers | ( | ) |
Definition at line 592 of file Control.cs.
List< string > CoreLink.Control.listWorkspaces | ( | ) |
Asks corelink for all available workspaces.
Definition at line 446 of file Control.cs.
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.
credentials | Contains username and password, writes to token |
Definition at line 93 of file Control.cs.
|
static |
Definition at line 634 of file Control.cs.
bool CoreLink.Control.rmWorkspace | ( | string | workspace | ) |
Asks the server to remove a workspace.
workspace | Name of workspace to be deleted |
Definition at line 396 of file Control.cs.
void CoreLink.Control.send | ( | uint | streamID, |
byte[] | header, | ||
byte[] | data ) |
Sends a UDP message to Corelink for a specific sender stream id.
streamID | Sender stream ID this data belongs to |
header | User custom header information |
data | Data to send to Corelink |
Definition at line 361 of file Control.cs.
bool CoreLink.Control.setDefaultWorkspace | ( | string | workspace | ) |
Requests Corelink to set the default workspace.
workspace | workspace name |
Definition at line 414 of file Control.cs.
JSONNode CoreLink.Control.streamInfo | ( | uint | streamID | ) |
Asks the server for information about a sender stream.
streamID | sender's streamID |
Definition at line 575 of file Control.cs.
List< uint > CoreLink.Control.subscribe | ( | List< uint > | streamIDs | ) |
Tells Corelink to subscribe a certain receiver stream to one or more sender streams.
streamIDs | Sender streams to subscribe to |
Definition at line 230 of file Control.cs.
List< uint > CoreLink.Control.unsubscribe | ( | List< string > | streamIDs | ) |
Unsubscribes the program from various sender streams.
filter | Sender streams ids to unsubscribe from |
Definition at line 266 of file Control.cs.
|
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.
|
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.