Skip to content

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.

Declaration
public sealed class LocalProgramConnection : ITerminalConnection, IProgramHost

Implements:
DarkEffekt.Terminal.ITerminalConnection, DarkEffekt.Terminal.IProgramHost

Declaration
public bool IsConnected { get; }
Declaration
public int Cols { get; }
Declaration
public int Rows { get; }

The hosted program.

Declaration
public ITerminalProgram Program { get; }

Starts connecting and returns at once; Connected or Closed reports the outcome.

Declaration
public void Connect()

Queues bytes for the far end. Never blocks on the network.

Declaration
public void Send(byte[] data, int offset, int count)
Type Name
System.Byte[] data
System.Int32 offset
System.Int32 count

The terminal grid changed size. Connections that can pass this on do.

Declaration
public void NotifyResize(int cols, int rows)
Type Name
System.Int32 cols
System.Int32 rows

Passes a frame tick to a program that implements DarkEffekt.Terminal.ITerminalTick.

Declaration
public void Tick(float deltaSeconds)
Type Name
System.Single deltaSeconds

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

Declaration
public void Dispose()

The stream is open and data can flow.

Declaration
public event Action Connected

System.Action

Declaration
public event Action<byte[]> DataReceived

System.Action<System.Byte[]>

Declaration
public event Action<CloseReason> Closed

System.Action<DarkEffekt.Terminal.CloseReason>