Class LocalProgramConnection
Adapts an ITerminalProgram to the connection interface, so the same session and renderers drive local programs and network services alike. All calls stay on the caller’s thread.
Assembly: DarkEffekt.Terminal.Core
Section titled “Assembly: DarkEffekt.Terminal.Core”public sealed class LocalProgramConnection : ITerminalConnection, IProgramHostImplements:
DarkEffekt.Terminal.ITerminalConnection, DarkEffekt.Terminal.IProgramHost
Properties
Section titled “Properties”IsConnected
Section titled “IsConnected”public bool IsConnected { get; }public int Cols { get; }public int Rows { get; }Program
Section titled “Program”The hosted program.
public ITerminalProgram Program { get; }Methods
Section titled “Methods”Connect()
Section titled “Connect()”Starts connecting and returns at once; Connected or Closed reports the outcome.
public void Connect()Send(byte[], int, int)
Section titled “Send(byte[], int, int)”Queues bytes for the far end. Never blocks on the network.
public 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 void NotifyResize(int cols, int rows)Parameters
Section titled “Parameters”| Type | Name |
|---|---|
System.Int32 |
cols |
System.Int32 |
rows |
Tick(float)
Section titled “Tick(float)”Passes a frame tick to a program that implements DarkEffekt.Terminal.ITerminalTick.
public void Tick(float deltaSeconds)Parameters
Section titled “Parameters”| Type | Name |
|---|---|
System.Single |
deltaSeconds |
Dispose()
Section titled “Dispose()”Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()Events
Section titled “Events”Connected
Section titled “Connected”The stream is open and data can flow.
public event Action ConnectedEvent Type
Section titled “Event Type”System.Action
DataReceived
Section titled “DataReceived”public event Action<byte[]> DataReceivedEvent Type
Section titled “Event Type”System.Action<System.Byte[]>
Closed
Section titled “Closed”public event Action<CloseReason> ClosedEvent Type
Section titled “Event Type”System.Action<DarkEffekt.Terminal.CloseReason>