Corelink C# Client Library
Loading...
Searching...
No Matches
Corelink C# Client

Overview

C# client library for Corelink, supporting WebSocket, TCP, and UDP data protocols.

Notes

These documents are a work in progress, and we are trying to improve upon them on a daily basis. However, given our capacity and workload, there are bound to be things which get missed or checked in which should not have been checked in. If you find mistakes or documents wanting information and you would like to help, you can do so in two ways

  1. Submit corrections. When you update anything and submit a PR, we will review it and if all looks good, it will be added. This is the fastest way that one can expect changes to be in.
  2. Submit tickets. If you are not sure how to make updates, or if you are short on time, please raise an issue in the repo, with details and what you think needs to be the expected text. We will try and update the literature to reflect any changes that we feel are merited. Note that this route will take longer than the first approach and there are no guarantees on the timeline.

Prerequisites

  • .NET 8.0 or later
  • Newtonsoft.Json (dotnet add package Newtonsoft.Json)

Project Structure

csharp/
├── Core/ # Client library (do not modify for app-specific code)
│ ├── CorelinkClient.cs # Control channel, auth, request-response handling
│ ├── CorelinkDefaults.cs # Default connection parameters (override in your code)
│ ├── CorelinkDataXchgWSProtocolManager.cs # WebSocket data channel
│ ├── CorelinkDataXchgTcpProtocolManager.cs # TCP data channel
│ └── CorelinkDataXchgUdpProtocolManager.cs # UDP data channel
├── Test/ # Example code (adapt for your own use)
│ ├── TestConfig.cs # Shared test credentials and settings
│ ├── MyAppClass.cs # Full lifecycle example (sender + receiver)
│ ├── Program.cs # Entry point
│ ├── SimpleWSSender.cs # Minimal WebSocket sender
│ ├── SimpleWSReceiver.cs # Minimal WebSocket receiver
│ ├── SimpleTCPSender.cs # Minimal TCP sender
│ ├── SimpleTCPReceiver.cs # Minimal TCP receiver
│ ├── SimpleUDPSender.cs # Minimal UDP sender
│ └── SimpleUDPReceiver.cs # Minimal UDP receiver

Running the Examples

Unified mode (recommended)

cd csharp
dotnet run

This runs the full lifecycle: connect → authenticate → list workspaces → create sender → create receiver → send data in a loop.

Override settings via CLI

dotnet run -- --username MyUser --password MyPass --workspace MyRoom --type audio --protocol ws

Individual sender/receiver tests

Run a sender (then choose w, t, or u for protocol):

dotnet run sender

Run a receiver with a specific protocol:

dotnet run receiver w # WebSocket
dotnet run receiver t # TCP
dotnet run receiver u # UDP
dotnet run receiver w 12345 # Subscribe to a specific stream ID

Control Function Tests

Run to verify each control function against the Corelink server:

dotnet run control

Configuration

Edit Test/TestConfig.cs to change default credentials, workspace, and protocol for the example project. The Core library has no hardcoded configuration — all values are passed in by the caller.

Documentation

For a detailed API documentation, please check out the document artifacts locally and then open the index.html in a browser of your choosing. Alternatively, if you are a fan of the command line, please refer to some commands that we have tried for ourselves. These are not exhaustive and if you use a distribution which is not listed here, please try it your way.

On Windows

start ./docs/artifacts/html/index.html

On OSX

open ./docs/artifacts/html/index.html

On Linux

xdg-open ./docs/artifacts/html/index.html

These documents should be supported on most major browsers (Safari, Mozilla Firefox, and the whole suit of Chromium based browsers).

We are trying to integrate them in to our overarching documentation framework as we speak. But as that will take a little while, you can use these static HTML pages with the same degree of assurance.

Before Making a Merge Request

cd csharp
dotnet format
dotnet build

Fix all errors and warnings before submitting.