Class TtydConnection
A terminal served by ttyd, the program that shares a command line over a WebSocket. It speaks ttyd’s framing: the grid size when the socket opens and again on every resize, input and output marked as such, and the server’s title and preference messages dropped. Give it the server’s WebSocket address, which ends in /ws.
Assembly: DarkEffekt.Terminal.Core
Section titled “Assembly: DarkEffekt.Terminal.Core”public sealed class TtydConnection : WebSocketConnection, ITerminalConnectionInheritance: System.Object -> DarkEffekt.Terminal.WebSocketConnection
Implements:
DarkEffekt.Terminal.ITerminalConnection
Properties
Section titled “Properties”AuthToken
Section titled “AuthToken”The credential a server started with one expects. Empty for none. Set before Connect.
public string AuthToken { get; set; }Methods
Section titled “Methods”OnConnected()
Section titled “OnConnected()”The socket is open. Runs before anything queued goes out and before Connected, so a message sent from here with SendRaw is the first the server reads.
protected override void OnConnected()HandleMessage(byte[])
Section titled “HandleMessage(byte[])”Processes one message from the server. The base class raises DataReceived with it.
protected override void HandleMessage(byte[] data)Parameters
Section titled “Parameters”| Type | Name |
|---|---|
System.Byte[] |
data |
Send(byte[], int, int)
Section titled “Send(byte[], int, int)”Queues bytes for the far end. Never blocks on the network.
public override void Send(byte[] data, int offset, int count)Parameters
Section titled “Parameters”| Type | Name |
|---|---|
System.Byte[] |
data |
System.Int32 |
offset |
System.Int32 |
count |
NotifyResize(int, int)
Section titled “NotifyResize(int, int)”The terminal grid changed size. Connections that can pass this on do.
public override void NotifyResize(int cols, int rows)Parameters
Section titled “Parameters”| Type | Name |
|---|---|
System.Int32 |
cols |
System.Int32 |
rows |