NAME

Test::FitNesse::Slim::Server - Serve FitNesse SLiM sessions over TCP or pipes

DESCRIPTION

The server owns transport framing and the per-session Test::FitNesse::Slim::ListExecutor. TCP connections and the port-1 stdin/stdout transport share the same frame reader, SLiM deserializer, executor, and response serializer. Each accepted connection receives isolated fixture, library, and symbol state.

Pipe protocol bytes are written through a dedicated stdout handle. Fixture stdout and stderr are captured separately and emitted as FitNesse v0.5 diagnostic records on stderr. TCP diagnostics use the normal process diagnostic stream. Transport and resource errors close the affected session and are reported on stderr; they do not manufacture a response for an incomplete message.

METHODS

new

my $server = Test::FitNesse::Slim::Server->new(%options);

Create a server. verbose enables request/response diagnostics, statement_timeout sets an optional per-invocation limit, max_frame_bytes overrides the outer frame limit, and bind_address selects the TCP listener's numeric IPv4 address. The bind address defaults to 127.0.0.1; explicitly configured non-loopback addresses produce an unauthenticated-listener warning when the TCP listener starts. Binding configuration cannot be used with pipe mode. The frame limit may also be configured with TEST_SLIM_MAX_FRAME_BYTES and defaults to 64 MiB. Invalid limits and bind addresses throw an error during construction.

run

$server->run($port);

my $remote = Test::FitNesse::Slim::Server->new(bind_address => '0.0.0.0');
$remote->run(8099);

Run the selected transport. Port 1 serves a single v0.5 pipe session over inherited standard input/output. Other valid ports create an IPv4 TCP listener at bind_address (loopback by default) and serve clients. The method runs until the pipe session ends or the TCP listener is stopped.

process

Process one connected TCP session on a bidirectional filehandle. This method is primarily used by the listener and transport tests.

process_pipe

Process one pipe session using distinct input and protocol-output filehandles. An optional diagnostic-output handle receives v0.5 tunneling records.

execute

Execute decoded instruction array references in the current session. This is a small integration-test hook; transport sessions normally use the internal list executor directly.

run_pipe

Prepare the standard handles for a FitNesse-managed child and run one pipe session. Protocol bytes go to the preserved stdout descriptor; ordinary stdout is redirected away from it.

PROTOCOL

The outer frame prefix counts UTF-8 payload bytes. Inner SLiM string lengths count UTF-16 code units. The server advertises Slim -- V0.5\n. A framed bye ends a session. See docs/slim-protocol-malformed-input.md and docs/slim-pipe-transport.md for framing limits and transport policy.