SocketTerminalHostServer class final
Reusable raw socket host server for remote TUI sessions.
This helper accepts TCP socket connections and can either hand each socket to onSession or run a fresh Model instance per connection through serveProgram.
Resize events are reported out-of-band using
OSC 9999;<cols>;<rows> terminated by BEL.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- onSession → SocketTerminalSessionHandler
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- server → ServerSocket
-
The underlying TCP server.
final
- uri → Uri
-
URI for connecting remote terminal clients.
no setter
Methods
-
close(
{bool force = false}) → Future< void> - Closes the underlying TCP server.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
bind(
{InternetAddress? address, int port = 2323, bool v6Only = false, required SocketTerminalSessionHandler onSession}) → Future< SocketTerminalHostServer> - Binds a socket host server.
-
resizeControlBytes(
{required int width, required int height, Encoding encoding = utf8}) → List< int> - Encodes resizeControlSequence as bytes for transport over a socket.
-
resizeControlSequence(
{required int width, required int height}) → String - Encodes a socket-host resize control sequence.
-
serveProgram<
M extends Model> ({InternetAddress? address, int port = 2323, bool v6Only = false, TerminalDimensions initialSize = (width: 80, height: 24), bool supportsAnsi = true, ColorProfile colorProfile = ColorProfile.trueColor, required M modelBuilder(), ProgramOptions options = const ProgramOptions(altScreen: false, frameTick: false, signalHandlers: false)}) → Future< SocketTerminalHostServer> - Binds a socket host server that runs a fresh program per connection.